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; });