5

The catalog URL rewrite indexers do not work correctly for some reasons. I realised something was wrong when, with FPC on (or Varnish), a wrong category (or no category at all) were set on the product view page. I tried to debug it a bit, and found out that the URL reindexer did not add any entries for target paths like catalog/product/view/id/XXX/category/YYY, even though the option "Use category path in product URL" is active. I simply found product URLs with no category attached like catalog/product/view/id/XXX. I though a full reindex would help in this, therefore I truncated all URL rewrite tables on my dev machine and run the indexer via CLI. Same result: no entry for products in the categories.

Puzzled, I did the same on a fresh install on Magento EE with test data: run installation, truncated all url_rewrite tables, and run a full reindex. Magento creates entries for category URLs, products URLs, but I found nothing for products with category paths. Is this a bug or a "feature"? Am I missing something here? Did anyone have the same problem?

EDIT:

I tried to investigate this issue a bit further. The Catalog URL and Product URL indexers are definitely not creating these rewrites, other than what happened in EE 1.12 / CE 1.7. The only place I could find where these rewrites are created is in enterprise_catalog/observer: the event observer is bound to catalog_product_save_after and generates the rewrites for product URLs including the category path. However, and this is something I don't get, these are not system paths as in the past (is_system is set to 0), but they are created as redirects.

  • Did you run the url scripts in the shell directory? url_migration_to_1_13.php I am pretty sure the test data is a previous version of Magento – brentwpeterson Oct 10 '13 at 22:22
  • Yes, I did everything by the book, even with the test data. I did a fresh install on 1.12 and then upgraded to 1.13 including migration scripts. Nothing changed. – fmrng Oct 11 '13 at 7:43
  • I experienced some similar issues, if you're using the Upgrade replay module, don't its what fubar'd the URL rewrites. Follow the upgrade docs carefully, and don't use the upgrade replay and see if you get the same results. – B00MER Dec 9 '13 at 23:32
2

Oddly when tracing this through the system these types of urls rewrites only get created when you set-up the product rewrite yourself or on product save and not on index.

You can trace how these are created by looking for the constant Mage_Catalog_Helper_Product::XML_PATH_PRODUCT_URL_USE_CATEGORY which is the setting from the system config.

It seems these urls are created in the function call _getProductUrl on the class Enterprise_Catalog_Model_Product_Url which in the enterprise version is the url model from products. As defined in the config xml snippet.

<catalog>
    <product>
        <url>
            <model>enterprise_catalog/product_url</model>
        </url>
    </product>
</catalog>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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