Skip to content

Commit

Permalink
Fixed exception when collection selects non-existent attribute in PR #…
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhiendl committed Mar 3, 2023
1 parent 0f104a7 commit 6352b46
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,10 @@ public function addAttributeToSelect($attribute, $joinType = false)
} else {
$attrInstance = Mage::getSingleton('eav/config')
->getAttribute($this->getEntity()->getType(), $attribute);
// failure to resolve an attribute from the eav config implies it does not exist
if (empty($attrInstance)) {
return $this;
}
}
if (empty($attrInstance)) {
throw Mage::exception(
Expand Down

0 comments on commit 6352b46

Please sign in to comment.