From d2d895fdf5fac1b02b7dec138920731a1841c531 Mon Sep 17 00:00:00 2001 From: Romain Quetiez Date: Tue, 9 May 2017 12:07:43 +0000 Subject: [PATCH] Archives: regression. Forms not working with various symptom having the same root cause: DBObject::Set issuing an exception "Attempting to set the value on the read-only attribute operational_status" SVN:trunk[4721] --- core/dbobject.class.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/core/dbobject.class.php b/core/dbobject.class.php index eb23475a1..5ab61e3e3 100644 --- a/core/dbobject.class.php +++ b/core/dbobject.class.php @@ -364,7 +364,14 @@ abstract class DBObject implements iDisplay } return $bFullyLoaded; } - + + protected function _Set($sAttCode, $value) + { + $this->m_aCurrValues[$sAttCode] = $value; + $this->m_aTouchedAtt[$sAttCode] = true; + unset($this->m_aModifiedAtt[$sAttCode]); + } + public function Set($sAttCode, $value) { if ($sAttCode == 'finalclass') @@ -451,13 +458,11 @@ abstract class DBObject implements iDisplay $realvalue = $oAttDef->MakeRealValue($value, $this); - $this->m_aCurrValues[$sAttCode] = $realvalue; - $this->m_aTouchedAtt[$sAttCode] = true; - unset($this->m_aModifiedAtt[$sAttCode]); + $this->_Set($sAttCode, $realvalue); foreach (MetaModel::ListMetaAttributes(get_class($this), $sAttCode) as $sMetaAttCode => $oMetaAttDef) { - $this->Set($sMetaAttCode, $oMetaAttDef->MapValue($this)); + $this->_Set($sMetaAttCode, $oMetaAttDef->MapValue($this)); } // The object has changed, reset caches