Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed broken grids caused by PR #2545 #2546

Merged
merged 1 commit into from
Sep 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 13 additions & 16 deletions app/code/core/Mage/Eav/Model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,11 @@ protected function _initAttributes($entityType)

/** @var Mage_Eav_Model_Resource_Entity_Attribute_Collection $attributesInfo */
$attributesInfo = Mage::getResourceModel($entityType->getEntityAttributeCollection());
$attributesInfo
->setEntityTypeFilter($entityType)
->getData();
$attributesInfo->setEntityTypeFilter($entityType);
$attributesInfoData = $attributesInfo->getData();

$codes = [];
foreach ($attributesInfo as $attribute) {
foreach ($attributesInfoData as $attribute) {
$this->_createAttribute($entityType, $attribute);
$codes[] = $attribute['attribute_code'];
}
Expand Down Expand Up @@ -472,10 +471,10 @@ public function getEntityAttributeCodes($entityType, $object = null)
$attributesInfo
->setEntityTypeFilter($entityType)
->setAttributeSetFilter($attributeSetId)
->addStoreLabel($storeId)
->getData();
->addStoreLabel($storeId);
$attributesInfoData = $attributesInfo->getData();
$attributes = [];
foreach ($attributesInfo as $attributeData) {
foreach ($attributesInfoData as $attributeData) {
$attributes[] = $attributeData['attribute_code'];
$this->_createAttribute($entityType, $attributeData);
}
Expand Down Expand Up @@ -524,17 +523,17 @@ public function preloadAttributes($entityType, $attributes)
$attributesInfo = Mage::getResourceModel($entityType->getEntityAttributeCollection());
$attributesInfo
->setEntityTypeFilter($entityType)
->setCodeFilter($attributes)
->getData();
->setCodeFilter($attributes);
$attributesInfoData = $attributesInfo->getData();

if (!$attributesInfo) {
if (!$attributesInfoData) {
Varien_Profiler::stop('EAV: '.__METHOD__ . ':'.$entityTypeCode);
return $this;
}

$attributesData = $codes = [];

foreach ($attributesInfo as $attribute) {
foreach ($attributesInfoData as $attribute) {
if (empty($attribute['attribute_model'])) {
$attribute['attribute_model'] = $entityType->getAttributeModel();
}
Expand All @@ -548,9 +547,7 @@ public function preloadAttributes($entityType, $attributes)
}

$this->_attributeData[$entityTypeCode] = $attributesData;

Varien_Profiler::stop('EAV: '.__METHOD__ . ':'.$entityTypeCode);

return $this;
}

Expand Down Expand Up @@ -619,10 +616,10 @@ public function loadCollectionAttributes($entityType, $attributes)
$attributesInfo
->useLoadDataFields()
->setEntityTypeFilter($entityType)
->setCodeFilter($attributes)
->getData();
->setCodeFilter($attributes);
$attributesInfoData = $attributesInfo->getData();

foreach ($attributesInfo as $attributeData) {
foreach ($attributesInfoData as $attributeData) {
$attribute = $this->_createAttribute($entityType, $attributeData);
$this->_collectionAttributes[$entityTypeCode][$attribute->getAttributeCode()] =$attribute;
}
Expand Down