0

I have 4 levels of category tree. After I've spent some hours setting up SEO, Sitemap and other stuff in Admin panel and Google developers account, something went wrong and 2nd levels categories not showing.

Other links and categories works perfect...

The record is below (sorry for its size):

a:5:{i:0;s:785:"SQLSTATE[42S22]: Column not found: 1054 Unknown
   column 'main_table.thumbnail' in 'field list', query was: SELECT
   `main_table`.`entity_id`, `main_table`.`level`, `main_table`.`path`,
   `main_table`.`position`, `main_table`.`is_active`,
   `main_table`.`is_anchor`, `main_table`.`name`, `main_table`.`image`,
   `main_table`.`thumbnail`, `main_table`.`is_anchor`,
   `url_rewrite`.`request_path` FROM `catalog_category_flat_store_1` AS
   `main_table`  LEFT JOIN `core_url_rewrite` AS `url_rewrite` ON
   url_rewrite.category_id = main_table.entity_id AND
   url_rewrite.is_system = 1  AND url_rewrite.store_id = 1 AND
   url_rewrite.id_path LIKE 'category/%' WHERE (path LIKE '1/2/10/%')
   AND (main_table.store_id = '1') AND (is_active = '1') AND (level <=
   4) AND (level > '2') ORDER BY level ASC, position ASC";i:1;s:4432:"#0
   /usr/share/nginx/www/default/lib/Varien/Db/Statement/Pdo/Mysql.php(110):
   Zend_Db_Statement_Pdo->_execute(Array)
   #1 /usr/share/nginx/www/default/app/code/core/Zend/Db/Statement.php(291):
   Varien_Db_Statement_Pdo_Mysql->_execute(Array)
   #2 /usr/share/nginx/www/default/lib/Zend/Db/Adapter/Abstract.php(480):
   Zend_Db_Statement->execute(Array)
   #3 /usr/share/nginx/www/default/lib/Zend/Db/Adapter/Pdo/Abstract.php(238):
   Zend_Db_Adapter_Abstract->query('SELECT `main_ta...', Array)
   #4 /usr/share/nginx/www/default/lib/Varien/Db/Adapter/Pdo/Mysql.php(428):
   Zend_Db_Adapter_Pdo_Abstract->query('SELECT `main_ta...', Array)
   #5 /usr/share/nginx/www/default/lib/Zend/Db/Adapter/Abstract.php(737):
   Varien_Db_Adapter_Pdo_Mysql->query('SELECT `main_ta...', Array)
   #6 /usr/share/nginx/www/default/lib/Varien/Data/Collection/Db.php(734):
   Zend_Db_Adapter_Abstract->fetchAll('SELECT `main_ta...', Array)
   #7 /usr/share/nginx/www/default/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(521):
   Varien_Data_Collection_Db->_fetchAll('SELECT `main_ta...', Array)
   #8 /usr/share/nginx/www/default/lib/Varien/Data/Collection/Db.php(566):
   Mage_Core_Model_Resource_Db_Collection_Abstract->getData()
   #9 /usr/share/nginx/www/default/app/code/community/TM/EasyCatalogImg/Block/List.php(131):
   Varien_Data_Collection_Db->load()
   #10 /usr/share/nginx/www/default/app/design/frontend/base/default/template/tm/easycatalogimg/list.phtml(2):
   TM_EasyCatalogImg_Block_List->getCategories()

   ... cut irrelevant parts ...

   #34 {main}";s:3:"url";s:15:"/gostinaja.html";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}

/gostinaja.html - is the address of subcategory I clicked on

Where the error is?

Thanks in advance!

1 Answer 1

1

You have not reindexed the flat category table after installing this extension as the thumbnail field isn't in the table. This extension seems to add it to the collection correctly, so a reindex should be all that is needed to fix it. Let us know if that doesn't work.

Can you disable flat category and see if it works then?

Can you also show the output of mysql -e 'SHOW CREATE TABLE catalog_category_flat_store_1\G'?

I can only imagine that the thumbnail attribute was deleted or renamed or it's type altered. There's no special setting for category attributes to get them into the flat table like there is with product attributes. You can add some debugging in app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php, in the _getAttributes() function. I'd do a Mage::log((string)$select); just after $select is made and Mage::log(var_export($this->_attributeCodes, true)); just before the return statement and then do a reindex. This should give you the fields the indexer is trying to create for the table.

4
  • Hi Melvyn, thanks for your reply. I've reindexed all of indexes, cleared cache - but it still doesn't work... This extension (easycatalogimg) worked perfectly after installing a couple of weeks ago till yesterday.
    – Oleksandr
    Mar 29, 2015 at 9:30
  • Many thanks, Melvin! I've disabled flat category - it works! Should it be enabled? Or I can leave it like that?
    – Oleksandr
    Mar 29, 2015 at 11:47
  • You can leave it like that, but your performance will suffer a little, since now the categories are fetched from several different tables instead of a single one. With small number of categories, it's not noticeable. I am however curious how the indexer got broken. Did you insert the logging to check?
    – user4351
    Mar 29, 2015 at 12:14
  • @Melvin Nope, I've added nothing like logging to check
    – Oleksandr
    Mar 29, 2015 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.