Details
-
Type:
Bug
-
Status:
Closed
-
Resolution: Fixed
-
Security Level: All-users
-
Labels:None
-
Similar issues:
PSCFV-5722No category name in product URL
PSCFV-4191 remove .html from 'Route to products'PSCFV-4978In route to product is variable "category" not working with friendy URL enabled - SEO & URLPSCFV-6517Dispatcher->loadRoutes replaces all custom routes with defaults
PSCFV-6561 default url changesPSCFV-3841'There is 1 error Product not found' when .html is removed from' Route to category' - SEO & URLSPSCFV-5995no category id in product url (product-list.tpl)PSCFV-9509getProductLink() does not take custom routes into account when called in back-office module
-
Affected version:1.5.3.0
Description
The new release 1.5.3.1 & 1.5.3.0 are impacted :
You cannot change the route formats in section SEO & URLS for products, categorie, manufacturers, etc...
I went thought the code and here is the FIX :
The problem is caused because the module hook route overrides are overridden by the default routes in function loadRoutes() in Dispatcher.php. The code loading defaults should be placed just under the hookExec.
====
File classes/Dispatcher.php line 441 :
====
// Set default routes
foreach (Language::getLanguages() as $lang)
foreach ($this->default_routes as $id => $route)
$this->addRoute(
$id,
$route['rule'],
$route['controller'],
$lang['id_lang'],
$route['keywords'],
isset($route['params']) ? $route['params'] : array()
);
===
This code was put at the wrong place. Move it under line 397 :
===
// Load custom routes from modules
$modules_routes = Hook::exec('moduleRoutes', array(), null, true, false);
if (is_array($modules_routes) && count($modules_routes))
foreach($modules_routes as $module_route)
foreach($module_route as $route => $route_details)
if (array_key_exists('controller', $route_details) && array_key_exists('rule', $route_details)
&& array_key_exists('keywords', $route_details) && array_key_exists('params', $route_details))
===========>>>>>>> Place previous code here <<<<<<<<<<<<<<===============
Issue Links
| Duplicate | |||
|---|---|---|---|
|
|||
Activity
| Field | Original Value | New Value |
|---|---|---|
| Link |
This issue duplicates |
| Assignee | Vincent AUGAGNEUR [ vAugagneur ] |
| Labels | Dispatcher SEO url url-rewrite |
| Status | Open [ 1 ] | Closed [ 6 ] |
| Resolution | Fixed [ 1 ] |