From 10be208d8d0bc560f0b7dbd75bfe856bae60356a Mon Sep 17 00:00:00 2001 From: yuri Date: Thu, 26 Jul 2018 12:26:25 +0300 Subject: [PATCH] fix linkedWith filter --- application/Espo/Core/SelectManagers/Base.php | 2 +- client/src/views/fields/link-multiple.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/application/Espo/Core/SelectManagers/Base.php b/application/Espo/Core/SelectManagers/Base.php index 18d709e0d1..43661c7d88 100644 --- a/application/Espo/Core/SelectManagers/Base.php +++ b/application/Espo/Core/SelectManagers/Base.php @@ -1255,7 +1255,7 @@ class Base $value = $item['value']; - if (is_null($value)) break; + if (is_null($value) || !$value && !is_array($value)) break; $relationType = $seed->getRelationType($link); diff --git a/client/src/views/fields/link-multiple.js b/client/src/views/fields/link-multiple.js index c952524a30..df984aff10 100644 --- a/client/src/views/fields/link-multiple.js +++ b/client/src/views/fields/link-multiple.js @@ -359,16 +359,19 @@ Espo.define('views/fields/link-multiple', 'views/fields/base', function (Dep) { var type = this.$el.find('select.search-type').val(); if (type === 'anyOf') { - var values = this.ids || []; + var idList = this.ids || []; var data = { type: 'linkedWith', - value: this.ids || [], + value: idList, nameHash: this.nameHash, data: { type: type } }; + if (!idList.length) { + data.value = null; + } return data; } else if (type === 'noneOf') { var values = this.ids || [];