N°1590: Advanced search: fixed a bug when selecting foreign keys would not add items (selectionMode is mandatory)

This commit is contained in:
steffunky
2018-10-12 10:48:32 +02:00
parent 460337954b
commit 0a34fb7a7a
2 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

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