mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-20 00:58:48 +02:00
N°1444 : fixed regression introduced in [r5724] & [r5773]
SVN:trunk[5809]
This commit is contained in:
@@ -508,7 +508,9 @@ class DBObjectSearch extends DBSearch
|
||||
$oParamExpression = new VariableExpression($sInParamName);
|
||||
$this->SetInternalParams(array($sInParamName => $aValues));
|
||||
|
||||
$oInCondition = new BinaryExpression($oFieldExpression, $sOperator, $oParamExpression);
|
||||
$oListExpression = new ListExpression(array($oParamExpression));
|
||||
|
||||
$oInCondition = new BinaryExpression($oFieldExpression, $sOperator, $oListExpression);
|
||||
$this->AddConditionExpression($oInCondition);
|
||||
}
|
||||
|
||||
|
||||
@@ -303,6 +303,10 @@ class BinaryExpression extends Expression
|
||||
{
|
||||
throw new CoreException('Expecting an Expression object on the right hand', array('found_class' => get_class($oRightExpr)));
|
||||
}
|
||||
if ( (($sOperator == "IN") || ($sOperator == "NOT IN")) && !$oRightExpr instanceof ListExpression)
|
||||
{
|
||||
throw new CoreException("Expecting a List Expression object on the right hand for operator $sOperator", array('found_class' => get_class($oRightExpr)));
|
||||
}
|
||||
$this->m_oLeftExpr = $oLeftExpr;
|
||||
$this->m_oRightExpr = $oRightExpr;
|
||||
$this->m_sOperator = $sOperator;
|
||||
@@ -1286,7 +1290,7 @@ class VariableExpression extends UnaryExpression
|
||||
$res = CMDBSource::Quote($aArgs[$this->m_sName]);
|
||||
if (is_array($res))
|
||||
{
|
||||
$res = '('.implode(', ', $res).')';
|
||||
$res = implode(', ', $res);
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user