?
avatar joomdonation
joomdonation
19 Dec 2015

Problem description

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.

avatar joomdonation joomdonation - open - 19 Dec 2015
avatar brianteeman brianteeman - change - 13 Jan 2016
Labels Added: ?
avatar brianteeman brianteeman - change - 11 Mar 2016
Category Router / SEF
avatar joomdonation joomdonation - change - 1 Aug 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-08-01 11:11:47
Closed_By joomdonation
avatar joomdonation joomdonation - close - 1 Aug 2016

Add a Comment

Login with GitHub to post a comment