N°1646 - Fix crash in case no value return (real fix about to be discussed)

This commit is contained in:
Molkobain
2023-06-13 09:36:20 +02:00
parent 0a45039c5c
commit 58a20e9a11

View File

@@ -1134,7 +1134,7 @@ JS
// N°6394 Make sure to sort elements as defined in the datamodel
if (utils::IsNotNullOrEmptyString($sStateAttrCode)) {
$oAttDef = MetaModel::GetAttributeDef($sClass, $sStateAttrCode);
$aAllowedValues = $oAttDef->GetAllowedValues();
$aAllowedValues = $oAttDef->GetAllowedValues() ?? [];
$AllowedValuesKeys = array_keys($aAllowedValues);
uksort($aStateLabels, function ($sKey1, $sKey2) use ($AllowedValuesKeys) {