Skip to content

Commit 028f783

Browse files
authored
Fixed broken grids caused by PR #2545 (#2546)
1 parent 2d79049 commit 028f783

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

app/code/core/Mage/Eav/Model/Config.php

+13-16
Original file line numberDiff line numberDiff line change
@@ -353,12 +353,11 @@ protected function _initAttributes($entityType)
353353

354354
/** @var Mage_Eav_Model_Resource_Entity_Attribute_Collection $attributesInfo */
355355
$attributesInfo = Mage::getResourceModel($entityType->getEntityAttributeCollection());
356-
$attributesInfo
357-
->setEntityTypeFilter($entityType)
358-
->getData();
356+
$attributesInfo->setEntityTypeFilter($entityType);
357+
$attributesInfoData = $attributesInfo->getData();
359358

360359
$codes = [];
361-
foreach ($attributesInfo as $attribute) {
360+
foreach ($attributesInfoData as $attribute) {
362361
$this->_createAttribute($entityType, $attribute);
363362
$codes[] = $attribute['attribute_code'];
364363
}
@@ -472,10 +471,10 @@ public function getEntityAttributeCodes($entityType, $object = null)
472471
$attributesInfo
473472
->setEntityTypeFilter($entityType)
474473
->setAttributeSetFilter($attributeSetId)
475-
->addStoreLabel($storeId)
476-
->getData();
474+
->addStoreLabel($storeId);
475+
$attributesInfoData = $attributesInfo->getData();
477476
$attributes = [];
478-
foreach ($attributesInfo as $attributeData) {
477+
foreach ($attributesInfoData as $attributeData) {
479478
$attributes[] = $attributeData['attribute_code'];
480479
$this->_createAttribute($entityType, $attributeData);
481480
}
@@ -524,17 +523,17 @@ public function preloadAttributes($entityType, $attributes)
524523
$attributesInfo = Mage::getResourceModel($entityType->getEntityAttributeCollection());
525524
$attributesInfo
526525
->setEntityTypeFilter($entityType)
527-
->setCodeFilter($attributes)
528-
->getData();
526+
->setCodeFilter($attributes);
527+
$attributesInfoData = $attributesInfo->getData();
529528

530-
if (!$attributesInfo) {
529+
if (!$attributesInfoData) {
531530
Varien_Profiler::stop('EAV: '.__METHOD__ . ':'.$entityTypeCode);
532531
return $this;
533532
}
534533

535534
$attributesData = $codes = [];
536535

537-
foreach ($attributesInfo as $attribute) {
536+
foreach ($attributesInfoData as $attribute) {
538537
if (empty($attribute['attribute_model'])) {
539538
$attribute['attribute_model'] = $entityType->getAttributeModel();
540539
}
@@ -548,9 +547,7 @@ public function preloadAttributes($entityType, $attributes)
548547
}
549548

550549
$this->_attributeData[$entityTypeCode] = $attributesData;
551-
552550
Varien_Profiler::stop('EAV: '.__METHOD__ . ':'.$entityTypeCode);
553-
554551
return $this;
555552
}
556553

@@ -619,10 +616,10 @@ public function loadCollectionAttributes($entityType, $attributes)
619616
$attributesInfo
620617
->useLoadDataFields()
621618
->setEntityTypeFilter($entityType)
622-
->setCodeFilter($attributes)
623-
->getData();
619+
->setCodeFilter($attributes);
620+
$attributesInfoData = $attributesInfo->getData();
624621

625-
foreach ($attributesInfo as $attributeData) {
622+
foreach ($attributesInfoData as $attributeData) {
626623
$attribute = $this->_createAttribute($entityType, $attributeData);
627624
$this->_collectionAttributes[$entityTypeCode][$attribute->getAttributeCode()] =$attribute;
628625
}

0 commit comments

Comments
 (0)