This is a weird one to explain.
I got a multi language site with associated login menu items. The language filter is configured for automatic language change.
When I am logged out and trying to access a menu item with access permissions https://test.com/en/somepagewithaccess , I will be redirected to the login page. The return URL is set to the correct page I want to get redirected to. When I sign in instead of getting to the correct return page I get to the login page instead.
Noticed in languagefilter onUserLogon event the code is a bit funky.
We retrieve the 'users.login.form.return' data and the next step is to check if it has an ItemId. This will fail for an SFE url as we don't have an item id for the redirect URL. Next step is to fall back to the active menu associated item and it will go to that.
After login user should be redirected to the right return URL.
After login redirected to the wrong page.
Joomla 3.9.25
PHP 7.3
Labels |
Added:
?
|
@Flowman
please explain in details what you mean with
When I am logged out and trying to access a menu item with access permissions https://test.com/en/somepagewithaccess
what kind of menu item and which access is it set to? (if it is not Public or Guest, it may not display at all).
Or does the link to that menu item is placed in an article for example?
I have a component that sends out an email to a menu item that has access permission of "registered" for an approval function.
First create "Login Form" menu items for each language.
Then create any type of menu item with any registered access permission, copy the URL when you are logged in, logout from the page and try to access the URL. When you login you will not get redirected to the correct URL when you have the "automatic language change" option in the language filter plugin enabled.
Check the code rows I attached in my first post and you will see what is going on.
Hmm. Still unclear.
Let's say we have 2 languages: en-GB and fr-FR
Site default language: ?
User login site default language: ?
The mail is including the link to registered menu item. As you specifiy the /en/
as url language code, it means that menu item is tagged to en-GB.
Is it always the same menu item tagged to en-GB? I.e https://test.com/en/somepagewithaccess
.
Or do you have also another one tagged to fr-FR, i.e. https://test.com/fr/somepagewithaccess
?
If yes, are these associated?
Is the user who is going to login has en-GB as site default language?
What exactly are the settings for the language filter? Please post a screenshot.
Now, what are the redirect urls of each login menu item? Specify their language tag.
Are these the ones specified above and associated?
If all this is as stated, then I confirm the issue. I get here the Log Out
page after logging.
The solution for you is to use the Internal URL
as login redirect and not the Menu Item
Wait a bit. I have to test something else.
I have the feeling that when we introduced the “login_redirect_menuitem” as an alternative to url we may have forgotten to take care of that param in the llanguage filter. Not sure though.
Wanted to record a gif for you, but Joomla lanucher is a bit broken and does not launch an new site for me.
Joomla lanucher is a bit broken and does not launch an new site for me
is reported: joomla/joomla-websites#1614 (comment)
@Bakual @bembelimen
Can you have a look at this?
login_redirect_menuitem
was added for 3.6.0 #10249
@Bakual @bembelimen
Can you have a look at this?
login_redirect_menuitem
was added for 3.6.0 #10249
This has nothing to do with the login_redirect_menuitem as I don't configure this on the menus. This is just a pure access redirect. Part of the SiteApplication->authorise from 3.2.0.
It's just funky maybe untested code, as it will break in SFE because the URI has not Itemid yet. Gave the details in my first post where it breaks.
This has nothing to do with the login_redirect_menuitem as I don't configure this on the menus.
You have not replied to me concerning the way your login menu items are configured:
The return URL is set to the correct page I want to get redirected to.
Please reply to my questions. Are you using redirects or not?
if yes WHAT type of redirect? Menu item or Internal Url?
Default config.
And still it does not use the redirect menu part. It is just no access redirect from here
I already tried to explain where the code is breaking :)
I understood perfectly what you did...
It can't use a redirect as you do not define a redirect when automatic_change
is set.
I quote you
The return URL is set to the correct page I want to get redirected to.
Your statement in the description of the issue is therefore somehow wrong as you rely on Default
.
In this case Default
means the login form itself and it shows the logout button when automatic_change
is set.
As I proposed above as an alternative, use Internal URL
and add the correct full url in the field, i.e. https://test.com/en/somepagewithaccess
.
Can't help more. Sorry. Take off automatic_change
in the meanwhile if it does not fit your needs.
Maybe someone else will be able to help you.
(Note: looks like we still have an issue with Menu Item
which has not been taken care of fully in the languagefilter.)
Okay lets re-explain as my first comment was not clear.
If I send a link to someone that you need to have a "registered" access level to access. He copies the link into the web browser. Now he is thrown to the login page as he does no have access to the page as a guest. When he logins in he should be redirected to the page sent in the link, not the login page itself.
I don't relay on the Default
redirect. I relay on the code I shown a couple of times in the SiteApplication authorise.
and this part here cannot handle it as it is sad.
The code is there to handle it but it is broken, and that is why I am reporting it, as I don't like to hack the core on my sites.
This whole thing work perfectly fine when SEF is not enabled and the "Itemid" is sent with the URL.
Hopefully someone else with have a go and can fix the issue as just disabling automatic_change
is not really a fix. Else take the whole broken code out and don't have an option to use it.
Labels |
Added:
J3 Issue
J4 Issue
|
Title |
|
Labels |
Added:
No Code Attached Yet
Removed: J3 Issue ? |
Labels |
Added:
bug
|
@infograf768 sorry to call you but do you have a comment for this issue?