? Pending

User tests: Successful: Unsuccessful:

avatar artur-stepien
artur-stepien
6 Jan 2021

Moved from #31076 with proper summary and testing instructions.

Summary of Changes

Fixes the issue with losing activation token when you click user account activation link in admin e-mail while your website uses multilingual content.

Testing Instructions

  • Use clean Joomla installation

  • Make sure you set an existing e-mail as administrator e-mail address or mailhog

  • Install and enable second language

  • Enable System - Language Filter plugin

  • Create new menu called Additional

  • Create new menu called Main menu Second

  • Move your current Home menu item to Additional menu

  • Copy Home menu item from Additional menu to Main menu, set its language to English and set it as deafult

  • Create Register menu item in English pointing to Register form (in Main menu) and set its access to Guest

  • Create Login menu item in English pointing to Login form (in Main menu)

  • Create Logout menu item in English pointing to Logout page (in Main menu)

  • Copy Home menu item from Additional menu to Main menu Second, set its language to your Second Language and set it as default

  • Create Register menu item in second language pointing to Register form (in Main menu Second) and set its access to Guest

  • Create Login menu item in second language pointing to Login form (in Main menu Second)

  • Create Logout menu item in second language pointing to Logout page (in Main menu Second)

  • Go to Modules and change Main Menu module language to English

  • Copy Main Menu module, change the "Select Menu" to "Main menu Second" and language to your Second Language

  • Add module of type Language Switcher and put it in "position-7"

  • Just to be sure, disable "Login Form" module (we're not going to use that one)

  • Go to Users -> Manage -> Options

  • Set "Allow User Registration" to Yes

  • Set "New User Account Activation" to "Administrator"

  • Set "Integration/Routing/URL Routing" to "Modern"

  • Now visit front-end

  • Register new user

  • Confirm your account on your e-mail

  • Click user account activation link you received on your administrator e-mail

Actual result BEFORE applying this Pull Request

Failed user activation.

Expected result AFTER applying this Pull Request

After clicking the user activation url by the administrator and logging-in into the system user account should be activated.

Documentation Changes Required

None

avatar artur-stepien artur-stepien - open - 6 Jan 2021
avatar artur-stepien artur-stepien - change - 6 Jan 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 6 Jan 2021
Category Front End Plugins
avatar infograf768
infograf768 - comment - 7 Jan 2021

Without patch
Multilingual site. SEF on. URL rewriting off.
Language filter set to Remove URL Language Code
Setting Users Options as stated
Logged out of backend.
Register new user in frontend through module
User receives mail with link
http://localhost:8888/newfolder/trunkgitnew/index.php/component/users/?task=registration.activate&token=7e11bd55a15e327e6165426c07607d3f&Itemid=103
User clicks to ask for activation
Admin receives emaIl
Link to activate user is
http://localhost:8888/newfolder/trunkgitnew/index.php/component/users/?task=registration.activate&token=aab6a49d027dc7e431181cc9f38df24d&Itemid=103

When clicking I get to login in frontend
Message
The user's account has been activated and the user has been notified about it.

Logging again in backend:
User is activated and enabled.

Therefore I can't reproduce the issue here

avatar infograf768
infograf768 - comment - 7 Jan 2021

So, my question is simple: how do you manage to not have a token?

avatar artur-stepien
artur-stepien - comment - 7 Jan 2021

@infograf768 This is what is in the current release:
https://github.com/joomla/joomla-cms/blob/3.9.23/plugins/system/languagefilter/languagefilter.php#L687
https://github.com/joomla/joomla-cms/blob/3.9.23/plugins/system/languagefilter/languagefilter.php#L699
https://github.com/joomla/joomla-cms/blob/3.9.23/plugins/system/languagefilter/languagefilter.php#L709
And it whipes all the data.

To get into the conditions above you need to have login redirect url set too, together with associations. So I assume I'll have to update the testing instructions.

avatar infograf768
infograf768 - comment - 7 Jan 2021

To get into the conditions above you need to have login redirect url set too, together with associations. So I assume I'll have to update the testing instructions.

Please do as precisely as possible as otherwise it is impossible to check your findings. and the patch.
Login redirect url set to what and where: in the module or in a menu item?
What should be associated?
Do you have some specific menu items?

avatar infograf768
infograf768 - comment - 10 Jan 2021

@artur-stepien
Eager to test, but I still need you update the instructions to reproduce the issue.

avatar infograf768
infograf768 - comment - 17 Jan 2021

1 instance of login module created for each Content Language, each with a login redirect to associated menu items tagged to that language and displaying item(s) also tagged to that language.

In any case, this patch breaks associated redirect urls when the user (even admin) successful login has to be redirected to the user default site language and the current language is not that user default site language.

I discovered a token issue, unrelated to the new user being activated (it is always activated), when the admin has logged out after approval and logins again. Therefore not corresponding to the PR description.

avatar artur-stepien
artur-stepien - comment - 17 Jan 2021

@infograf768 I was testing this from scratch and on a clean installation. And the issue was visible when you set Registration form page Access to Guest (that was done to prevent registered users from seeing registration form) and using Modern router set in Users component options (on Legacy it worked just fine - at least for me). Tried to repeat it multiple times and sometimes it caused errors, sometimes it didn't. Therefore I can't pinpoint the exact set of settings. The only thing I'm sure of is that those 3 lines I provided above will wipe any redirection data after login (when user reaches those conditions). I'll give it a try again in few days outside of Docker machine. Maybe Docker is messing with my results.

avatar artur-stepien artur-stepien - change - 17 Jan 2021
The description was changed
avatar artur-stepien artur-stepien - edited - 17 Jan 2021
avatar artur-stepien
artur-stepien - comment - 17 Jan 2021

@infograf768 I did put the whole process I usedto pinpoint the issue today in Testing Instructions. I'll clear my head and try that again later.

avatar infograf768
infograf768 - comment - 18 Jan 2021

Will wait for any new input from you as your instructions are very confusing.
It would be much more easy to understand if you just first installed the multilingual site when installing a clean Joomla.

Anyway, keep in mind my comment above as your patch is a no-no as is :

In any case, this patch breaks associated redirect urls when the user (even admin) successful login has to be redirected to the user default site language and the current language is not that user default site language.

avatar infograf768
infograf768 - comment - 27 Mar 2021

As we have no News from author for 2 months, closing this.
Can be reopened if necessary

avatar infograf768 infograf768 - change - 27 Mar 2021
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2021-03-27 09:17:09
Closed_By infograf768
Labels Added: ?
avatar infograf768 infograf768 - close - 27 Mar 2021

Add a Comment

Login with GitHub to post a comment