Merge remote-tracking branch 'origin/support/3.0' into develop

This commit is contained in:
Eric Espie
2022-08-09 09:27:49 +02:00
2 changed files with 21 additions and 0 deletions

View File

@@ -211,14 +211,23 @@ class UIExtKeyWidget
$sClassAllowed = $oAllowedValues->GetClass();
$bAddingValue = false;
// N°4792 - load only the required fields
$aFieldsToLoad = [];
$aComplementAttributeSpec = MetaModel::GetNameSpec($oAllowedValues->GetClass(), FriendlyNameType::COMPLEMENTARY);
$sFormatAdditionalField = $aComplementAttributeSpec[0];
$aAdditionalField = $aComplementAttributeSpec[1];
if (count($aAdditionalField) > 0) {
$bAddingValue = true;
$aFieldsToLoad[$sClassAllowed] = $aAdditionalField;
}
$sObjectImageAttCode = MetaModel::GetImageAttributeCode($sClassAllowed);
if (!empty($sObjectImageAttCode)) {
$aFieldsToLoad[$sClassAllowed][] = $sObjectImageAttCode;
}
$aFieldsToLoad[$sClassAllowed][] = 'friendlyname';
$oAllowedValues->OptimizeColumnLoad($aFieldsToLoad);
$bInitValue = false;
while ($oObj = $oAllowedValues->Fetch()) {
$aOption = [];