#152 Suppress errors reported by the data model consistency check

SVN:trunk[620]
This commit is contained in:
Romain Quetiez
2010-07-21 15:16:34 +00:00
parent 6fc2b4127b
commit 650e5002af
4 changed files with 27 additions and 12 deletions

View File

@@ -676,6 +676,21 @@ class AttributeClass extends AttributeString
parent::__construct($sCode, $aParams);
}
public function GetDefaultValue()
{
$sDefault = parent::GetDefaultValue();
if (!$this->IsNullAllowed() && is_null($sDefault))
{
// For this kind of attribute specifying null as default value
// is authorized even if null is not allowed
// Pick the first one...
$aClasses = $this->GetAllowedValues();
$sDefault = key($aClasses);
}
return $sDefault;
}
public function GetAsHTML($sValue)
{
return MetaModel::GetName($sValue);