From 82a8a0bba7ea8ee430942e472facc80246665a68 Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Wed, 17 Sep 2014 15:41:35 +0000 Subject: [PATCH] #932: fixed a regression introduced by [r3319]... in case a criteria is present several times. SVN:trunk[3344] --- core/dbobjectset.class.php | 7 +++++-- core/expression.class.inc.php | 7 +------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/core/dbobjectset.class.php b/core/dbobjectset.class.php index 3a98dad37..fd10138b0 100644 --- a/core/dbobjectset.class.php +++ b/core/dbobjectset.class.php @@ -1098,8 +1098,11 @@ class DBObjectSet { foreach($aVals as $sCode => $oExpr) { - $oScalarExpr = $oExpr->GetAsScalar($aScalarArgs); - $aConst[$sClassAlias][$sCode] = $oScalarExpr->GetValue(); + if (is_object($oExpr)) // Array_merge_recursive creates an array when the same key is present multiple times... ignore them + { + $oScalarExpr = $oExpr->GetAsScalar($aScalarArgs); + $aConst[$sClassAlias][$sCode] = $oScalarExpr->GetValue(); + } } } return $aConst; diff --git a/core/expression.class.inc.php b/core/expression.class.inc.php index 9623834fc..f70c26b74 100644 --- a/core/expression.class.inc.php +++ b/core/expression.class.inc.php @@ -299,13 +299,8 @@ class BinaryExpression extends Expression { $aResult[$this->m_oRightExpr->GetParent()][$this->m_oRightExpr->GetName()] = $this->m_oLeftExpr; } - else - { - // Strictly, this should be removed - $aResult = array_merge_recursive($this->m_oRightExpr->ListConstantFields(), $this->m_oLeftExpr->ListConstantFields()); - } } - else + else if ($this->m_sOperator == 'AND') { // Strictly, this should be done only for the AND operator $aResult = array_merge_recursive($this->m_oRightExpr->ListConstantFields(), $this->m_oLeftExpr->ListConstantFields());