I'm running Magento 22.214.171.124 and I got an issue on about 1/3 of my 5000 products.
When I echo the code bellow, 1/3 return "index" and the other return "product".
They should all return "product". I don't know why few are bugged.
I tried to rebuild the whole index from the BO but it didn't solve the issue.
In my layout.xml, I have a definition of "my catalog_product_view".
I've also "cms_index_index" for the homepage (which returns also "index" when I use getControllerName().
Be cause of that wrong controllerName returned, the template is a mess.
I got a mix between a product page, a cms page and a 404 error page.
What is this all about? How can I fix this?
Got more informations. I analysed the values returned by the controller:
Here are the differences:
Wrong product page:
- [action] => Mage_Cms_IndexController Object - [_route:protected] => cms - [_controllerModule:protected] => Mage_Cms - [_module:protected] => cms - [_controller:protected] => index - [_action:protected] => noRoute
Good product page:
- [action] => Francecreation_PrintProduct_ProductController Object - [_route:protected] => catalog - [_controllerModule:protected] => Francecreation_PrintProduct - [_module:protected] => catalog - [_controller:protected] => product - [_action:protected] => view
Digging a bit more.
Cache is off
Compilation is off
Wrong URL is in core_url_rewrite
If I access to the page with /catalog/product/view/id/xxx - the problem is still visible.