diff --git a/pages/UI.php b/pages/UI.php index 2668b94e0..e3670c9db 100644 --- a/pages/UI.php +++ b/pages/UI.php @@ -939,6 +939,21 @@ try } } + $sStateAttCode = MetaModel::GetStateAttributeCode($sClass); + if (($sStateAttCode != '') && ($oDummyObj->GetState() == '')) + { + // Hmmm, it's not gonna work like this ! Set a default value for the "state" + // Maybe we should use the "state" that is the most common among the objects... + $aMultiValues = $aValues[$sStateAttCode]; + uasort($aMultiValues, 'MyComparison'); + foreach($aMultiValues as $sCurrValue => $aVal) + { + $oDummyObj->Set($sStateAttCode, $sCurrValue); + break; + } + //$oStateAtt = MetaModel::GetAttributeDef($sClass, $sStateAttCode); + //$oDummyObj->Set($sStateAttCode, $oStateAtt->GetDefaultValue()); + } $oP->add("