I hope you can help me with this strange error.

Currently, we are working in a store with EE 1.14 and we are seeing a problem with category's url keys and url paths: They always return null. For example, if I execute the following:

$_cat   =   Mage::getModel('catalog/category')->load($_catId);
echo $_cat->getUrlKey() . '<br />';
echo $_cat->getUrlPath() . '<br />';

Both return me null​​. If I disable the Category Flat in the store, the error is fixed and both values ​​are printed correctly. However, while it is enabled in the store, this persists.

I checked the table catalog_category_flat_store_1 and I noticed that, indeed, url_key and url_path fields have NULL value for all categories of the store. But in catalog_category_entity_url_key, url keys are stored correctly.

If I go to the backend, I'm going to a category, and manually save it, the url_key is stored and reflected in catalog_category_flat_store_1 correctly. However, if I run the reindexing:

php indexer.php --reindex catalog_product_flat

The url_key disappears again (ie, its value changes back to null).

It is noteworthy that only happens with the categories, not products. Do you know what could be causing this and how to fix it?

Greetings and thanks in advance for your support.

  • This may help you: magento.stackexchange.com/questions/24768/… – Kalpesh Sep 4 '14 at 23:41
  • Thanks for your reply! That's exactly my same problem indeed, but I don't think that the answer in that post is correct, as it seems more like a patch and could not do that in each module that makes the call. Furthermore, reviewing the core, it still makes explicitly called to ->getUrlKey() and ->getUrlPath() and returns empty in both cases. For example in app\code\core\Mage\Catalog\controllers\CategoryController.php line 155 and 156. This makes me think that something is wrong indeed. – Eliacim DAVILA - CENSERE Sep 5 '14 at 14:37