Published: June 7, 2020
Last updated:

OpenMage: Invalid attribute name: main_table.store_id

The following exception is thrown on attempt to load catalog after migration/upgrade to OpenMage 19.4.3:

Invalid attribute name: main_table.store_id


Solution

Apply the very next commit after OpenMage v19.4.3 release:
$ git diff ef443a74..cf4c5a54
diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Collection.php
index 7244895..d50f071 100644
--- a/app/code/core/Mage/Catalog/Model/Resource/Category/Collection.php
+++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Collection.php
@@ -381,7 +381,7 @@ class Mage_Catalog_Model_Resource_Category_Collection extends Mage_Catalog_Model
      */
     public function addStoreFilter()
     {
-        $this->addFieldToFilter('main_table.store_id', $this->getStoreId());
+        $this->setProductStoreId($this->getStoreId());
         return $this;
     }

Source: https://github.com/OpenMage/magento-lts/issues/939

Posted in: Known issues

6 votes, 2.50 avg. rating (52% score)