Bladeren bron

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"

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4721 a333f486-631f-4898-b8df-5754b55c2be0
romainq 8 jaren geleden
bovenliggende
commit
15b1f85700
1 gewijzigde bestanden met toevoegingen van 10 en 5 verwijderingen
  1. 10 5
      core/dbobject.class.php

+ 10 - 5
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