Redirect URL in login module without Itemid?

79 views
Skip to first unread message

FR

unread,
Jun 17, 2015, 6:52:11 AM6/17/15
to joomla-...@googlegroups.com
Hi all,

is there any reason why we do not append the Itemid to the return URL in the login module? I can choose a menu item where I want to get users redirected after login and logout from the select box in the backend module options and it sets the return URL into the module form in the frontend. But without an Itemid the page where I will be redirected to does not contain the modules that are assigned to this page.

This is the code in the modules/mod_login/helper.php:
public static function getReturnURL($params, $type)
{
$app = JFactory::getApplication();
$item   = $app->getMenu()->getItem($params->get($type));

if ($item)
{
$vars = $item->query;
       }
else
{
// Stay on the same page
$vars = $app::getRouter()->getVars();
}

return base64_encode('index.php?' . JUri::buildQuery($vars));
}

$item->query does only contain all query variables from the menu item except the Itemid. A simple fix could be to add another line with $vars['Itemid'] = $item->id after it.

Would something like this be possible or is there anything that I am missing here?

Kind regards
Florian

Tuan Pham Ngoc

unread,
Jun 17, 2015, 8:23:36 AM6/17/15
to joomla-...@googlegroups.com
Hi Florian

That was a bug and It was fixed. You can see better code at https://github.com/joomla/joomla-cms/blob/staging/modules/mod_login/helper.php#L30 . This fix will be included in 3.4.2. 

FR

unread,
Jun 17, 2015, 8:50:53 AM6/17/15
to joomla-...@googlegroups.com
Nice, thank you :-)
Reply all
Reply to author
Forward
0 new messages