While discussing about the issue #8689, Brian reported that if we set login redirect URL to a SEF url to index.php/park-home (a sef url), after logged in, users will be redirected to index.php/park-home/login and It causes 404 error (please note that the active menu item has login alias)
Looking at the code, I see that it causes by a bug in JRoute::_ method when a sef url is passed into method parameter. It causes by this block of code in JRouteSite https://github.com/joomla/joomla-cms/blob/staging/libraries/cms/router/site.php#L676-L684
if ($option = $this->getVar('option'))
{
$uri->setVar('option', $option);
}
if ($itemid = $this->getVar('Itemid'))
{
$uri->setVar('Itemid', $itemid);
}
With that code, when Joomla could not get option and Itemid from the url (which is in the case sef URL is passed to the method), it uses the option and Itemid from active menu link for building the return URL. As you can see, if the link is from a different component with the component of active menu link, it will causes the wrong URL generated and 404 error.
Labels |
Added:
?
|
Category | ⇒ | Router / SEF |
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-08-01 11:11:47 |
Closed_By | ⇒ | joomdonation |