From a908dcd752bb586817813c8a961927bb46962bae Mon Sep 17 00:00:00 2001 From: Romain Quetiez Date: Thu, 15 Sep 2016 10:01:32 +0000 Subject: [PATCH] #1178 Internals: Object Update/Reload should never fail: as soon as a given object has been read in the current execution context, updating/reloading it is not an issue. SVN:trunk[4402] --- core/dbobject.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/dbobject.class.php b/core/dbobject.class.php index 3e493ee7b..500664056 100644 --- a/core/dbobject.class.php +++ b/core/dbobject.class.php @@ -192,10 +192,14 @@ abstract class DBObject implements iDisplay return true; } + /** + * @param bool $bAllowAllData DEPRECATED: the reload must never fail! + * @throws CoreException + */ public function Reload($bAllowAllData = false) { assert($this->m_bIsInDB); - $aRow = MetaModel::MakeSingleRow(get_class($this), $this->m_iKey, false /* must be found */, $bAllowAllData/* in the future $this->m_bAllowAllData ??*/); + $aRow = MetaModel::MakeSingleRow(get_class($this), $this->m_iKey, false /* must be found */, true /* AllowAllData */); if (empty($aRow)) { throw new CoreException("Failed to reload object of class '".get_class($this)."', id = ".$this->m_iKey); @@ -1931,6 +1935,7 @@ abstract class DBObject implements iDisplay { $oFilter = new DBObjectSearch(get_class($this)); $oFilter->AddCondition('id', $this->m_iKey, '='); + $oFilter->AllowAllData(); $sSQL = $oFilter->MakeUpdateQuery($aDBChanges); CMDBSource::Query($sSQL);