Fixed stopper issue (found with an audit) due to copies of DBObjectSearch not cloned (or not cloned well)

There is still one place where this should be fixed, but it reveals another bug so we've decided to leave it as is for the moment (see comment in DBObjectSearch::AddCondition_PointingTo)

SVN:trunk[2497]
This commit is contained in:
Romain Quetiez
2012-12-04 13:26:48 +00:00
parent 90bc24d5c0
commit 1e155ffc13
6 changed files with 35 additions and 22 deletions

View File

@@ -52,7 +52,7 @@ class DisplayBlock
public function __construct(DBObjectSearch $oFilter, $sStyle = 'list', $bAsynchronous = false, $aParams = array(), $oSet = null)
{
$this->m_oFilter = clone $oFilter;
$this->m_oFilter = $oFilter->DeepClone();
$this->m_aConditions = array();
$this->m_sStyle = $sStyle;
$this->m_bAsynchronous = $bAsynchronous;
@@ -414,7 +414,7 @@ class DisplayBlock
foreach($aGroupBy as $iRow => $iCount)
{
// Build the search for this subset
$oSubsetSearch = clone $this->m_oFilter;
$oSubsetSearch = $this->m_oFilter->DeepClone();
$oCondition = new BinaryExpression($oGroupByExp, '=', new ScalarExpression($aValues[$iRow]));
$oSubsetSearch->AddConditionExpression($oCondition);
$sFilter = urlencode($oSubsetSearch->serialize());
@@ -492,7 +492,7 @@ class DisplayBlock
$sHtml .= "<table>\n";
// Construct a new (parametric) query that will return the content of this block
$oBlockFilter = clone $this->m_oFilter;
$oBlockFilter = $this->m_oFilter->DeepClone();
$aExpressions = array();
$index = 0;
foreach($aGroupByFields as $aField)
@@ -726,7 +726,7 @@ class DisplayBlock
$oAttDef = MetaModel::GetAttributeDef($sClass, $sStateAttrCode);
foreach($aStates as $sStateValue)
{
$oFilter = clone($this->m_oFilter);
$oFilter = $this->m_oFilter->DeepClone();
$oFilter->AddCondition($sStateAttrCode, $sStateValue, '=');
$oSet = new DBObjectSet($oFilter);
$aCounts[$sStateValue] = $oSet->Count();
@@ -911,7 +911,7 @@ EOF
foreach($aGroupBy as $iRow => $iCount)
{
// Build the search for this subset
$oSubsetSearch = clone $this->m_oFilter;
$oSubsetSearch = $this->m_oFilter->DeepClone();
$oCondition = new BinaryExpression($oGroupByExp, '=', new ScalarExpression($aValues[$iRow]));
$oSubsetSearch->AddConditionExpression($oCondition);
$aURLs[$idx] = $oSubsetSearch->serialize();