N°4399 Fix memory error on setup when lots of attachment in DB

This commit is contained in:
Pierre Goiffon
2021-11-24 16:55:34 +01:00
parent 2d67594ccf
commit 312a5b246b

View File

@@ -177,6 +177,12 @@ SQL;
SetupPage::log_info("Initializing attachment/item_org_id - zero to the container");
$oSearch = DBObjectSearch::FromOQL("SELECT Attachment WHERE item_org_id = 0");
$oSet = new DBObjectSet($oSearch);
$oSet->OptimizeColumnLoad([
'Attachment' => [
'item_class',
'item_id',
]
]);
$iUpdated = 0;
while ($oAttachment = $oSet->Fetch())
{