Fixed regression due to the changes with 'finalclass', the value stored in the DB was the base class.

SVN:trunk[382]
This commit is contained in:
Romain Quetiez
2010-05-01 17:20:56 +00:00
parent 5ad54c02cb
commit c18f731660
2 changed files with 14 additions and 1 deletions

View File

@@ -685,6 +685,8 @@ class AttributeFinalClass extends AttributeString
$this->m_sCode = $sCode;
$aParams["allowed_values"] = null;
parent::__construct($sCode, $aParams);
$this->m_sValue = $this->Get("default_value");
}
public function IsWritable()
@@ -692,6 +694,15 @@ class AttributeFinalClass extends AttributeString
return false;
}
public function SetFixedValue($sValue)
{
$this->m_sValue = $sValue;
}
public function GetDefaultValue()
{
return $this->m_sValue;
}
public function GetAsHTML($sValue)
{
return MetaModel::GetName($sValue);

View File

@@ -926,7 +926,9 @@ abstract class MetaModel
{
throw new CoreException("Class $sChildClass, 'finalclass' is a reserved keyword, it cannot be used as a filter code");
}
self::$m_aAttribDefs[$sChildClass]['finalclass'] = clone $oClassAtt;
$oCloned = clone $oClassAtt;
$oCloned->SetFixedValue($sChildClass);
self::$m_aAttribDefs[$sChildClass]['finalclass'] = $oCloned;
self::$m_aAttribOrigins[$sChildClass]['finalclass'] = $sRootClass;
$oClassFlt = new FilterFromAttribute($oClassAtt);