advanced search: bugfix

FK search with negative selection was failling if the exclusion list was empty ("not in" cannot be apployed on an empty array)

SVN:trunk[5610]
This commit is contained in:
Bruno Da Silva
2018-04-05 08:35:03 +00:00
parent a84748a544
commit fcffe9d188

View File

@@ -469,16 +469,20 @@ class utils
// Paginated selection
$aSelectedIds = utils::ReadParam('storedSelection', array());
if ($sSelectionMode == 'positive')
if (count($aSelectedIds) > 0 )
{
// Only the explicitly listed items are selected
$oFullSetFilter->AddCondition('id', $aSelectedIds, 'IN');
}
else
{
// All items of the set are selected, except the one explicitly listed
$oFullSetFilter->AddCondition('id', $aSelectedIds, 'NOTIN');
if ($sSelectionMode == 'positive')
{
// Only the explicitly listed items are selected
$oFullSetFilter->AddCondition('id', $aSelectedIds, 'IN');
}
else
{
// All items of the set are selected, except the one explicitly listed
$oFullSetFilter->AddCondition('id', $aSelectedIds, 'NOTIN');
}
}
$aSelectedObj = array();
$oFullSet = new DBObjectSet($oFullSetFilter);
$sClassAlias = $oFullSetFilter->GetClassAlias();