[imp] Multilanguage: allowing any login redirection from login module or login/logout menu items#9724
Conversation
|
NEW: Test: |
|
This is incomplete. Have to solve the redirection when login to see an article. |
|
Hi Jean-Marie, I am testing your code with a specific use case where the redirect is not to an article but to a Menu Item.
I then have a user "User" with has it-it as preferred language. If he lands on the english home of the site and he chooses to login anyway on the english form he will be redirected to the en Home page, despite his preferred language. Don't you think the menu item association should be used too? I think you already do it for login module (line n.575 of languagefilter.php) but not for the login menu. |
|
I am working on this aspect as the only way to get this possibility is to set the url to the menu item in the login menu item as, for example, I already have the code for that by using a supplementary field of the type But we have a more important issue to solve first: Let's say we have an article set to registered and one has to login to see the full article. Here, It does not return to the article and I have an Error : You are not authorised, etc. Trying to figure what happens here. |
|
Hmm |
|
Possibly related item #7204 This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9724. |
|
@mannybiker Please test #10249 Then apply this patch too and choose a menu item in the login menu item redirection. |
|
If #10249 is merged, you can directly test this. Please test by choosing a menu item (in the Module or/and the Login Menu Item) in a language which is NOT the user preferred language. Associate the menu item to another menu item in the preferred default language for the user logging. Now display the language which is NOT the user preferred language in frontend where the switcher or/and the Login Menu item are displayed. Log through the module or the login menu item: the user will be redirected to the menu item in his preferred language. This completes #10249 @mannybiker @MATsxm @brianteeman @andrepereiradasilva ( @mannybiker Now your specific issue should be solved. I.e. By choosing a menu item in the Login menu item and access as guest, you will be able to redirect to another page (with special or public access) than the Login menu item (usually Home page) and if associated, in the user preferred language. ) |
|
Hmm, after merging #10249 (or patching it first), we can't apply this to test as it will have conflicts. |
|
Ok, solved. Now both PR can be tested together. |
|
@infograf768 @mannybiker I am a little confused with all these PR numbers flying around. So let's get this straightened out.
Thanks. |
|
#9710 confirm can be closed. I will test the new PR from infograf768 very soon |
|
#9724 tested and working for both menu and module login. My original issue is indeed fixed with this PR and the user preferred language is correctly taken into account when login redirection and associations are correctly configured. Really good job as usual @infograf768 :) |
|
Please mark the test as successful at https://issues.joomla.org/tracker/joomla-cms/9724 :) |
|
I have tested this item ✅ successfully on 34f5bbf This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9724. |
|
I have tested this item ✅ successfully on 34f5bbf This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9724. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9724. |
|
Merged, thanks everybody. |
Pull Request for Issue #9710 plus some
This PR allows choosing any redirection when login on a multilanguage site.
Before, in the login module as well as in the login or logout menu item, no redirection could be set.
Some redirections were only implemented when there were associations and Automatic change was set using the user preferred site language.
This should still work when no redirection is set.
But now, one can redirect to any menu item in the module without a 404 when the redirection is set to a menu item set to another language than the one displayed with the module, same for the logout menu item. I.e. the user preferred language will be ignored in these cases.
NEW: Except if the chosen menu item is associated to one in the user preferred language. See below.
For the login menu item, we do not use the same field
menuitemthan the module, i.e. it is a simpletextfield.It implies the correct formatting of the url entered for the redirect url in the login menu item: it should always be an internal url and should include
&lang=xx-XXin it in non SEF although a SEF url may work but not advised if moving site.Examples:
To test, patch and try all possibilites: with redirections or not, automatic language change set or not.