(Retrofit from trunk) N°1582 Fix audit when a current organization is set and there is an audit rule with valid=true

Was generating an OQL missing query argument error (r5991)

SVN:2.5[5992]
This commit is contained in:
Pierre Goiffon
2018-08-01 09:13:15 +00:00
parent 821eb4df8c
commit c3f80a5876
2 changed files with 37 additions and 3 deletions

View File

@@ -127,5 +127,3 @@ class SecurityException extends CoreException
class ArchivedObjectException extends CoreException
{
}
?>

View File

@@ -497,6 +497,8 @@ class DBObjectSearch extends DBSearch
* @param bool $bPositiveMatch if true will add a IN filter, else a NOT IN
*
* @throws \CoreException
*
* @since 2.5 N°1418
*/
public function AddConditionForInOperatorUsingParam($sFilterCode, $aValues, $bPositiveMatch = true)
{
@@ -506,7 +508,7 @@ class DBObjectSearch extends DBSearch
$sInParamName = $this->GenerateUniqueParamName();
$oParamExpression = new VariableExpression($sInParamName);
$this->SetInternalParams(array($sInParamName => $aValues));
$this->GetInternalParamsByRef()[$sInParamName] = $aValues;
$oListExpression = new ListExpression(array($oParamExpression));
@@ -1086,11 +1088,45 @@ class DBObjectSearch extends DBSearch
return $this->m_aParams = $aParams;
}
/**
* @return array <strong>warning</strong> : array returned by value
* @see self::GetInternalParamsByRef to get the attribute by reference
*/
public function GetInternalParams()
{
return $this->m_aParams;
}
/**
* @return array
* @see http://php.net/manual/en/language.references.return.php
* @since 2.5.1 N°1582
*/
public function &GetInternalParamsByRef()
{
return $this->m_aParams;
}
/**
* @param string $sKey
* @param mixed $value
* @param bool $bDoNotOverride
*
* @throws \CoreUnexpectedValue if $bDoNotOverride and $sKey already exists
*/
public function AddInternalParam($sKey, $value, $bDoNotOverride = false)
{
if ($bDoNotOverride)
{
if (array_key_exists($sKey, $this->m_aParams))
{
throw new CoreUnexpectedValue("The key $sKey already exists with value : ".$this->m_aParams[$sKey]);
}
}
$this->m_aParams[$sKey] = $value;
}
public function GetQueryParams($bExcludeMagicParams = true)
{
$aParams = array();