From 2bedae959f85e01799dc5a5992feaea3fc93eb98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Hub=C3=A1=C4=8Dek?= Date: Sat, 12 Dec 2020 22:16:19 +0100 Subject: [PATCH] Move storeId operations inside if statement (#1261) --- .../core/Mage/Catalog/Model/Resource/Abstract.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/code/core/Mage/Catalog/Model/Resource/Abstract.php b/app/code/core/Mage/Catalog/Model/Resource/Abstract.php index 5cb83e89015..6053b28d38e 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Abstract.php @@ -635,12 +635,13 @@ public function getAttributeRawValue($entityId, $attribute, $store) /** * Collecting typed attributes, performing separate SQL query for each attribute type table */ - if ($store instanceof Mage_Core_Model_Store) { - $store = $store->getId(); - } - - $store = (int)$store; if ($typedAttributes) { + if ($store instanceof Mage_Core_Model_Store) { + $store = $store->getId(); + } + + $store = (int)$store; + foreach ($typedAttributes as $table => $_attributes) { $select = $adapter->select() ->from(array('default_value' => $table), array('attribute_id'))