diff --git a/application/utils.inc.php b/application/utils.inc.php index 7e44ac4f8..84b37326c 100644 --- a/application/utils.inc.php +++ b/application/utils.inc.php @@ -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();