? Success
Pull Request for # 9710

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
4 Apr 2016

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:

  • index.php?option=com_content&view=article&id=151&catid=21&lang=es-ES&Itemid=131
  • index.php?Itemid=136&lang=fr-FR

To test, patch and try all possibilites: with redirections or not, automatic language change set or not.

avatar infograf768 infograf768 - open - 4 Apr 2016
avatar infograf768 infograf768 - change - 4 Apr 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 4 Apr 2016
Labels Added: ?
avatar infograf768
infograf768 - comment - 4 Apr 2016
avatar brianteeman brianteeman - change - 4 Apr 2016
Category Multilanguage
avatar brianteeman brianteeman - change - 4 Apr 2016
Rel_Number 0 9710
Relation Type Pull Request for
avatar infograf768
infograf768 - comment - 8 Apr 2016

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.

fa61805 8 Apr 2016 avatar infograf768 cs
avatar infograf768
infograf768 - comment - 10 Apr 2016

This is incomplete. Have to solve the redirection when login to see an article.

avatar mannybiker
mannybiker - comment - 10 Apr 2016

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

    • Home - EN (URL index.php?option=com_content&view=featured&layout=blank&Itemid=810&lang=en)
    • Login - EN (com_users) (Redirect URL index.php?option=com_content&view=featured&layout=blank&Itemid=810&lang=en)
  • Menu - IT

    • Home - IT (URL index.php?option=com_content&view=featured&layout=blank&Itemid=613&lang=it)
    • Login - IT (com_users) (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.

avatar infograf768
infograf768 - comment - 11 Apr 2016

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.

avatar infograf768
infograf768 - comment - 11 Apr 2016

Hmm
#9846

avatar brianteeman
brianteeman - comment - 15 Apr 2016

Possibly related item #7204


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9724.

avatar infograf768
infograf768 - comment - 5 May 2016

@mannybiker Please test #10249

Then apply this patch too and choose a menu item in the login menu item redirection.

avatar infograf768
infograf768 - comment - 7 May 2016

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. )

avatar infograf768
infograf768 - comment - 7 May 2016

Hmm, after merging #10249 (or patching it first), we can't apply this to test as it will have conflicts.

avatar infograf768
infograf768 - comment - 7 May 2016

Ok, solved. Now both PR can be tested together.

avatar roland-d
roland-d - comment - 7 May 2016

@infograf768 @mannybiker I am a little confused with all these PR numbers flying around. So let's get this straightened out.

Thanks.

avatar infograf768
infograf768 - comment - 7 May 2016

#9710 can be closed
#9826 is obsolete. we will provide hints and new tip for the login menu item. will close.

avatar mannybiker
mannybiker - comment - 7 May 2016

#9710 confirm can be closed. I will test the new PR from infograf768 very soon

avatar mannybiker
mannybiker - comment - 7 May 2016

#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 :)

avatar infograf768
infograf768 - comment - 7 May 2016

Please mark the test as successful at https://issues.joomla.org/tracker/joomla-cms/9724 :)

avatar mannybiker mannybiker - test_item - 7 May 2016 - Tested successfully
avatar mannybiker
mannybiker - comment - 7 May 2016

I have tested this item :white_check_mark: 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! ;)


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9724.

avatar alikon alikon - test_item - 8 May 2016 - Tested successfully
avatar alikon
alikon - comment - 8 May 2016

I have tested this item :white_check_mark: successfully on 34f5bbf


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9724.

avatar brianteeman brianteeman - change - 8 May 2016
Status Pending Ready to Commit
avatar brianteeman
brianteeman - comment - 8 May 2016

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9724.

avatar joomla-cms-bot joomla-cms-bot - change - 8 May 2016
Labels Added: ?
avatar brianteeman brianteeman - change - 8 May 2016
Milestone Added:
avatar roland-d roland-d - change - 8 May 2016
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
avatar roland-d roland-d - close - 8 May 2016
avatar roland-d roland-d - merge - 8 May 2016
avatar joomla-cms-bot joomla-cms-bot - close - 8 May 2016
avatar roland-d roland-d - reference | 9955e4c - 8 May 16
avatar roland-d roland-d - merge - 8 May 2016
avatar roland-d roland-d - close - 8 May 2016
avatar joomla-cms-bot joomla-cms-bot - change - 8 May 2016
Labels Removed: ?
avatar roland-d
roland-d - comment - 8 May 2016

Merged, thanks everybody.

Add a Comment

Login with GitHub to post a comment