User tests: Successful: Unsuccessful:
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 menuitem
than the module, i.e. it is a simple text
field.
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-XX
in 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.
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Category | ⇒ | Multilanguage |
Rel_Number | 0 | ⇒ | 9710 |
Relation Type | ⇒ | Pull Request for |
NEW:
When Automatic Change is set in the language filter plugin, added the association redirect to the user preferred language menu item if the redirection in the login module is set to a menu item associated to that language.
Test:
in the login modules(s), choose a login redirection to any menu item.
(Make sure the said menu item is associated to a menu item in the user preferred language.)
If that menu item is associated to a menu item tagged to the user preferred language, it is that last one that will display after login.
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 have 2 Menus, one for each language and with 2 Menu items each, like this:
Menu - EN
(URL index.php?option=com_content&view=featured&layout=blank&Itemid=810&lang=en)
(Redirect URL index.php?option=com_content&view=featured&layout=blank&Itemid=810&lang=en)
Menu - IT
(URL index.php?option=com_content&view=featured&layout=blank&Itemid=613&lang=it)
(Redirect URL index.php?option=com_content&view=featured&layout=blank&Itemid=613&lang=it)
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.
Hope what I say makes sense.
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, index.php?Itemid=136&lang=it-IT
, where 136 is the menu item id.
See the discussion here: #9826
I already have the code for that by using a supplementary field of the type menuitem
and not text
. Needs still some tweaking.
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.
Possibly related item #7204
@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.
If it is not yet, patch first with #10269
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.
Set Automatic Change to Yes in the language filter.
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. )
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.
#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
I was wondering how you put this "tested" mark in the comments. Many thanks!! Sorry, I'm still learning all these tools! ;)
I have tested this item successfully on 34f5bbf
Status | Pending | ⇒ | Ready to Commit |
Labels |
Added:
?
|
Milestone |
Added: |
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-05-08 15:14:01 |
Closed_By | ⇒ | roland-d |
Labels |
Removed:
?
|
Merged, thanks everybody.
@andrepereiradasilva
@javigomez
@mannybiker