From 0a34fb7a7a8879ec67496697b6044d7504a18121 Mon Sep 17 00:00:00 2001 From: steffunky Date: Fri, 12 Oct 2018 10:48:32 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B01590:=20Advanced=20search:=20fixed=20a?= =?UTF-8?q?=20bug=20when=20selecting=20foreign=20keys=20would=20not=20add?= =?UTF-8?q?=20items=20(selectionMode=20is=20mandatory)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/utils.inc.php | 4 ++-- js/searchformforeignkeys.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/utils.inc.php b/application/utils.inc.php index 581b63089..cdf90877b 100644 --- a/application/utils.inc.php +++ b/application/utils.inc.php @@ -464,9 +464,9 @@ class utils { $sSelectionMode = utils::ReadParam('selectionMode', ''); - if ($sSelectionMode === '') + if ($sSelectionMode != 'positive' && $sSelectionMode != 'negative') { - throw new CoreException('selectionMode is mandatory'); + throw new CoreException('selectionMode must be either positive or negative'); } // Paginated selection diff --git a/js/searchformforeignkeys.js b/js/searchformforeignkeys.js index da43278a4..6e54ac7c5 100644 --- a/js/searchformforeignkeys.js +++ b/js/searchformforeignkeys.js @@ -229,7 +229,7 @@ function SearchFormForeignKeys(id, sTargetClass, sAttCode, oSearchWidgetElmt, sF var selectionMode = $(':input[name="selectionMode"]', context); if (selectionMode.length > 0) { // Paginated table retrieve the mode and the exceptions - theMap['selectionMode'] = selectionMode.val(); + theMap['selectionMode'] = (selectionMode.val() == 'negative') ? 'negative' : 'positive'; $('#fs_SearchFormToAdd_'+me.id+' :input').each(function () { theMap[this.name] = this.value; });