diff --git a/application/ui.extkeywidget.class.inc.php b/application/ui.extkeywidget.class.inc.php index b94a9bb96..80c6c8be9 100644 --- a/application/ui.extkeywidget.class.inc.php +++ b/application/ui.extkeywidget.class.inc.php @@ -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 = []; diff --git a/core/dbsearch.class.php b/core/dbsearch.class.php index f532fb839..74e4feb7f 100644 --- a/core/dbsearch.class.php +++ b/core/dbsearch.class.php @@ -1724,4 +1724,16 @@ abstract class DBSearch { $this->SetShowObsoleteData(utils::ShowObsoleteData()); } + + /** + * To ease the debug of filters + * @internal + * + * @return string + * + */ + public function __toString() + { + return $this->ToOQL(); + } }