mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-12 23:14:18 +01:00
Fix audit bug (DBUnionSearch::AddConditionForInOperatorUsingParam() does not exist) when category is a UNION and rule flag 'Valid objects?' is 'true' and there are invalid entries in the result of the audit.
This commit is contained in:
@@ -628,4 +628,22 @@ class DBUnionSearch extends DBSearch
|
||||
$oSearch->SetDataFiltered();
|
||||
}
|
||||
}
|
||||
|
||||
public function AddConditionForInOperatorUsingParam($sFilterCode, $aValues, $bPositiveMatch = true)
|
||||
{
|
||||
$sInParamName = $this->GenerateUniqueParamName();
|
||||
foreach ($this->aSearches as $iSearchIndex => $oSearch)
|
||||
{
|
||||
$oFieldExpression = new FieldExpression($sFilterCode, $oSearch->GetClassAlias());
|
||||
|
||||
$sOperator = $bPositiveMatch ? 'IN' : 'NOT IN';
|
||||
|
||||
$oParamExpression = new VariableExpression($sInParamName);
|
||||
$oSearch->GetInternalParamsByRef()[$sInParamName] = $aValues;
|
||||
|
||||
$oListExpression = new ListExpression(array($oParamExpression));
|
||||
$oInCondition = new BinaryExpression($oFieldExpression, $sOperator, $oListExpression);
|
||||
$oSearch->AddConditionExpression($oInCondition);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user