N°4173 Fix memory_limit exhausted when having ExtKey widget pointing on class with AttributeBlob

Was failing when opening an object form, and when the list contained target objects with total file size above memory_limit
This commit is contained in:
Pierre Goiffon
2021-08-10 18:28:52 +02:00
parent e3d2c1d761
commit 714294e1b4

View File

@@ -82,6 +82,12 @@ class UIExtKeyWidget
$aArgs = [], $bSearchMode = false, &$sInputType = ''
)
{
// we will only use key & name, so let's reduce fields loaded !
$aAttToLoad = [
$sClass => [], // nothing, id and friendlyname are automatically added by the API
];
$oAllowedValues->OptimizeColumnLoad($aAttToLoad);
$oAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode);
$sTargetClass = $oAttDef->GetTargetClass();
$iMaxComboLength = $oAttDef->GetMaximumComboLength();