? Failure

User tests: Successful: Unsuccessful:

avatar coolcat-creations
coolcat-creations
7 Dec 2016

Pull Request for Issue #11176 .

Summary of Changes

  • Removed return false if Menu Item is selected and URL is filled
  • Added clear the field to avoid conflicts

Test instructions:

Before the Patch:

  1. Create or open a Login Menu Item
  2. chose the Internal URL redirect type in login or logout (doesn´t matter)
  3. type in for example just index.php
  4. Save
  5. change the redirect type to Menu Item and select any Menu item
  6. Click on save

Actual result: You get an warning message "Only one of the login redirect fields should have a value." the new selection is not saved. -> This is no good UX and might confuse a lot of users

After the patch:

  1. Create or open a Login Menu Item
  2. chose the Internal URL redirect type in login or logout (test both)
  3. type in for example just index.php
  4. Save
  5. change the redirect type to Menu Item and select any Menu item
  6. Click on save.

The Internal URL redirect will be cleared, if you select an Menu Item Type and save.
The Menu Item Type will be cleared, if you select Internal URL and save.

avatar coolcat-creations coolcat-creations - open - 7 Dec 2016
avatar coolcat-creations coolcat-creations - change - 7 Dec 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 7 Dec 2016
Category Front End com_users
avatar laoneo
laoneo - comment - 7 Dec 2016

As the issue became too big to figure out what the problem is. Can you describe here how we can reproduce the issue, that we can help you with the code.

avatar infograf768
infograf768 - comment - 7 Dec 2016

We can't have both the redirect_url and redirect_menuitem filled as these params are one or the other.
If one does that, then a Warning is displayed:
Only one of the login redirect fields should have a value.
and the form is not saved.
Not a bug imho.

avatar coolcat-creations
coolcat-creations - comment - 7 Dec 2016

Yes, sure :)

  1. Create or open a Login Menu Item
  2. chose the Internal URL redirect type in login or logout (doesn´t matter)
  3. type in for example just index.php
  4. Save
  5. change the redirect type to Menu Item and select any Menu item
  6. Click on save

Actual result: You get an warning message "Only one of the login redirect fields should have a value." the new selection is not saved.

Expected behaviour:

  1. The login and logout first check for the chosen redirect method and take the saved parameter behind that (Thats what i wanted to achieve with my codechange in this PR)

  2. Another possibility: Clear the second field when changing the redirect type

image

Thank you!

avatar infograf768
infograf768 - comment - 7 Dec 2016

Another possibility: Clear the second field when changing the redirect type

AND a value is entered in the first field... Otherwise it would clear the second field whenever someone switch redirects just to check what it does...

avatar coolcat-creations
coolcat-creations - comment - 7 Dec 2016

@infograf768 yes indeed, thank you - but maybe first option is easier, i just don´t understand why my chosen field skips always to Internal URL in this PR

avatar infograf768
infograf768 - comment - 7 Dec 2016

I guess you first have to delete the content of the url field. Here it works fine.

avatar coolcat-creations
coolcat-creations - comment - 7 Dec 2016

That´s the UX issue i mention, i don´t want to force the user to delete the input field, because the user made the decision to chose another method. It´s not a nice workflow...

avatar infograf768
infograf768 - comment - 7 Dec 2016

then it is certainly not by the code you propose that this will be solved.
We DO have to set false if both are filled.

avatar cpfeifer
cpfeifer - comment - 7 Dec 2016

This is a little over my head in terms of a fix, maybe a stronger programmer than myself can help us out here.

As mentioned in the original issue, the problem seems to be stemming from the numeric check located at component/com_users/controllers/users.php line 165, or one of the other conditionals.

I'm thinking we need another check which only checks for the actively selected option, or a way to only use the actively selected option in the menu item. I believe the error comes from not having a distinction between the actively selected item and the non-selected item, either menu item or internal URL.

Like I said, this is a little bit over my head and there's a lot going on there, but it seems like a solution would be relatively simple to implement. All ideas and suggestions are appreciated.

avatar cpfeifer
cpfeifer - comment - 7 Dec 2016

Theoretically it should be fine to have values stored in both fields as only one of the values will actually be used. When there are values assigned to both fields it causes the error. We just need a way to get around that.

avatar dgt41
dgt41 - comment - 7 Dec 2016

@coolcat-creations coolcat-creations#6 that should be enough

avatar coolcat-creations coolcat-creations - change - 7 Dec 2016
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 7 Dec 2016
Category Front End com_users Administration com_menus Front End com_users
avatar laoneo
laoneo - comment - 8 Dec 2016

Does @dgt41 patch made this PR ready for testing, or is there still some stuff open?

avatar infograf768
infograf768 - comment - 8 Dec 2016

I am going to test this right now, in mono and multilingual.

avatar coolcat-creations
coolcat-creations - comment - 8 Dec 2016

Don´t test yet, does´t work for now

avatar infograf768
infograf768 - comment - 8 Dec 2016

Indeed

avatar coolcat-creations
coolcat-creations - comment - 8 Dec 2016

I revert my changes because the method from @dgt41 clears the other field....
but it doesn´t work yet... maybe someone can have a look

https://gyazo.com/b33d075fe1b80da5cb14686f8f490c8e

avatar dgt41
dgt41 - comment - 20 Dec 2016
62d8285 20 Dec 2016 avatar dgrammatiko fixes
avatar coolcat-creations
coolcat-creations - comment - 21 Dec 2016

Thank you!
I merged it but still the same issue that it switches back to Menu Item ;(

avatar dgt41
dgt41 - comment - 21 Dec 2016

it switches back to Menu Item

The login or the logout?

avatar coolcat-creations
coolcat-creations - comment - 21 Dec 2016

yeah the login works, the logout jumps back to Internal URL all the time

40549fc 21 Dec 2016 avatar dgrammatiko fixes
avatar coolcat-creations
coolcat-creations - comment - 21 Dec 2016

Thank you @dgt41 works now! PR can be tested now i update the test instructions immediately @infograf768 @laoneo would be great if you can test

avatar coolcat-creations coolcat-creations - change - 21 Dec 2016
The description was changed
avatar coolcat-creations coolcat-creations - edited - 21 Dec 2016
avatar infograf768
infograf768 - comment - 21 Dec 2016

will test later on. tomorrow likely

avatar infograf768
infograf768 - comment - 22 Dec 2016

@coolcat-creations
My test show that when saving a login form, we have 2 cases:

A. If both the Internal URL field and Menu Item fields have values.
In this case the redirection is set depending on the button highlighted for the Choose Login redirect Type and the other value is deleted.

B. When we have only one value set, for example for the Menu Item field and the highlighted button is set to Internal URL, the Menu Item field value is deleted and then there is no specific redirection.

Is it what you expect?

avatar coolcat-creations
coolcat-creations - comment - 23 Dec 2016

A shouldn´t happen with this PR, if you select and save another redirection type the other field is cleared so the system has no issue regarding the "inputs behind". So no two fields should be possible to be filled at once....

avatar lausianne
lausianne - comment - 12 Jun 2017

If just the error message was clearer and gave a hint to the solution, I'd consider that a fix already. No extensive programming or testing needed ... (but of course, I do appreaciate real fixes, too)

avatar korneliusz401 korneliusz401 - test_item - 10 Aug 2017 - Tested successfully
avatar korneliusz401
korneliusz401 - comment - 10 Aug 2017

I have tested this item successfully on 1eba19c

I have tested both Login and Logout successfully.


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

avatar sanderpotjer sanderpotjer - test_item - 31 Aug 2017 - Tested successfully
avatar sanderpotjer
sanderpotjer - comment - 31 Aug 2017

I have tested this item successfully on 1eba19c


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

avatar franz-wohlkoenig franz-wohlkoenig - change - 1 Sep 2017
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 1 Sep 2017

RTC after two successful tests.

avatar mbabker mbabker - change - 1 Sep 2017
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-09-01 12:10:21
Closed_By mbabker
Labels Added: ?
avatar mbabker mbabker - close - 1 Sep 2017
avatar mbabker mbabker - merge - 1 Sep 2017

Add a Comment

Login with GitHub to post a comment