From 6352b46657d264895390886dc92eba2ce5a50e63 Mon Sep 17 00:00:00 2001 From: David Hiendl Date: Fri, 3 Mar 2023 10:32:49 +0100 Subject: [PATCH] Fixed exception when collection selects non-existent attribute in PR #2993 (#3038) --- app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php index c6ff2e91992..b00181f8885 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php @@ -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(