Skip to content

Commit 1c9c36c

Browse files
ACPT-490
Splitting $attributesToLoadFromTable into chunks
1 parent a91ff53 commit 1c9c36c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/code/Magento/CatalogImportExport/Model/Import/Product/Type/AbstractType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,9 @@ protected function _initAttributes()
320320
unset(self::$commonAttributesCache[$addedAttribute['id']]['options_use_table']);
321321
}
322322
}
323-
if (!empty($attributesToLoadFromTable)) {
323+
foreach (array_chunk($attributesToLoadFromTable, 1000) as $attributesToLoadFromTableChunk) {
324324
$collection = $this->attributeOptionCollectionFactory->create();
325-
$collection->setAttributeFilter(['in' => $attributesToLoadFromTable]);
325+
$collection->setAttributeFilter(['in' => $attributesToLoadFromTableChunk]);
326326
$collection->setStoreFilter(\Magento\Store\Model\Store::DEFAULT_STORE_ID);
327327
foreach ($collection as $option) {
328328
$attributeId = $option->getAttributeId();

0 commit comments

Comments
 (0)