mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-19 00:28:47 +02:00
#152 Suppress errors reported by the data model consistency check
SVN:trunk[620]
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user