Skip to content

Commit 28eac1f

Browse files
ENGCOM-4553: Fix importFromArray by setting _isCollectionLoaded to true after import #21869
- Merge Pull Request #21869 from slackerzz/magento2:fix_collection_importFromArray - Merged commits: 1. 2f49a5c 2. 3773c27 3. 0de4572
2 parents d81b399 + 0de4572 commit 28eac1f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ public function setEntity($entity)
264264
$this->_entity = $this->_eavEntityFactory->create()->setType($entity);
265265
} else {
266266
throw new LocalizedException(
267-
__('The "%1" entity supplied is invalid. Verify the entity and try again.', print_r($entity, 1))
267+
__('The entity supplied to collection is invalid. Verify the entity and try again.')
268268
);
269269
}
270270
return $this;
@@ -1061,6 +1061,7 @@ public function importFromArray($arr)
10611061
$this->_items[$entityId]->addData($row);
10621062
}
10631063
}
1064+
$this->_setIsLoaded();
10641065
return $this;
10651066
}
10661067

@@ -1164,7 +1165,6 @@ public function _loadEntities($printQuery = false, $logQuery = false)
11641165
* @param bool $printQuery
11651166
* @param bool $logQuery
11661167
* @return $this
1167-
* @throws LocalizedException
11681168
* @throws \Exception
11691169
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
11701170
* @SuppressWarnings(PHPMD.NPathComplexity)

0 commit comments

Comments
 (0)