By Jordan Weinstein on Friday, 18 December 2015
Posted in Technical Issues
Likes 0
Views 1K
Votes 0
Hello,

Ever since upgrading to Joomla 3.4.6, after user login, the URL is redirected to user profile, even if 'stay on the same page' is selected in Users > Authentication > Stay on the same page

Jordan
This might be related to this issue here:

https://github.com/joomla/joomla-cms/issues/8689
·
Friday, 18 December 2015 13:33
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Jordan,

Hm, I was debugging another user's site earlier and noticed this as well especially the "isInternalUrl" method. However, if you are logging in via one of EasySocial's form (doesn't go through com_users) it should be fine.

Where are you logging in from?
·
Friday, 18 December 2015 17:28
·
0 Likes
·
0 Votes
·
0 Comments
·
Actually, even if you login via EasyDiscuss's toolbar for example, it will redirect to EasySocial user profile.

It seems to be an issue for third-party login forms as well as com_user menu item and it seems to be a known issue according to that Github page above. I noticed that mod_login does not do this; in other words, using mod_login with the Default or 'same-page' login redirection option set, then it works fine. That helper sets the return URL like this:

public static function getReturnUrl($params, $type)
{
$app = JFactory::getApplication();
$item = $app->getMenu()->getItem($params->get($type));

if ($item)
{
$url = 'index.php?Itemid=' . $item->id;
}
else
{
// Stay on the same page
$url = JUri::getInstance()->toString();
}

return base64_encode($url);
}


And by this method, things seem to work for same-page login redirection. Not so with EasyDiscuss/Social/Blog or a number of other 3d party login forms.

Jordan
·
Friday, 18 December 2015 19:18
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Jordan,

I am pretty sure this is a bug with the way Joomla 3.4.6 handle's the "return" url. The checks seems to be checking if the return url doesn't have a scheme (http://site.com) which in most cases it doesn't have when you are on SEF mode.

Nevertheless, we could always quickly patch this from our end but I am just wondering what happens if they decide to address this in 3.4.7 and we'll have to revert the changes again

Temporarily, can you try downloading the attached file and upload it into /components/com_easyblog/views/
·
Saturday, 19 December 2015 16:01
·
0 Likes
·
0 Votes
·
0 Comments
·
Yup, that works. I guess I will have to find similar code in ES and ED?

Jordan
·
Sunday, 20 December 2015 01:03
·
0 Likes
·
0 Votes
·
0 Comments
·
In ED, looks like this would be in /com_easydiscus/controllers/controller.php, changing:

$return 		= JRequest::getURI();


to:

$return 		= JURI::getInstance()->toString();


Jordan
·
Sunday, 20 December 2015 01:08
·
0 Likes
·
0 Votes
·
0 Comments
·
Yep, that's correct Jordan It seems like with 3.4.6, it requires the full url including the domain name. Previously it doesn't require that
·
Sunday, 20 December 2015 15:23
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post