? Failure

User tests: Successful: Unsuccessful:

avatar zero-24
zero-24
2 Sep 2014

Issue

JTracker: http://issues.joomla.org/tracker/joomla-cms/4142
Gh: #4142

Login redirect don't work for external URLs and currently we use a simple text field to store the value.
I would vote for changing the behavior on the com_users login form to the behavior that we have on mod_login that only internal urls are allow and use a dropdown to select it.
This is a workable solution

How to test

  1. apply patch
  2. create a new menu itm with the com_users login view. (not mod_login ;))
  3. choose a login redirect page with the dropdown
  4. choose a logout redirect page with the dropdown
  5. save
  6. login by using this menu itm
  7. make sure the redirect is correct
  8. logout by using the menu itm
  9. make sure the redirect is correct

This is B/C save

The old way is that we use a string containing the redirect url that stored in the params the new way is to store the ID.
This part of code will handel it:

$itemid = $params->get($type);

if (is_numeric($itemid))
{
[...]
}
if ($itemid != '')
{
        // For B/C reasons
        // The value in the param is not a number and not null
        // so the param store a old value like a URL and it will used.
        $url = $itemid;
}

https://github.com/zero-24/joomla-cms/blob/patch-10/components/com_users/helpers/login.php#L62-68

If the params stores a old value like a url it will be used. If it store the id it also works.

Possible B/C break

if someone override one of these files (the views):
https://github.com/zero-24/joomla-cms/blob/patch-10/components/com_users/views/login/tmpl/default_logout.php
https://github.com/zero-24/joomla-cms/blob/patch-10/components/com_users/views/login/tmpl/default_login.php

They need to change the line

<input type="hidden" name="return" value="<?php echo base64_encode($this->params->get('logout_redirect_url', $this->form->getValue('return'))); ?>" />

to

<input type="hidden" name="return" value="<?php echo $this->redirect; ?>" />
Question

Is this a B/C Issue so this need to wait for 4.0 or can we add this to 3.3/3.4?
If it is a B/C Issue can we handel this any how?

Other mirror changes

  • Some mirror CS issues specifically on the default.xml file.
  • Move the TFA function (getTwoFactorMethods()) to UsersHelperLogin
avatar zero-24 zero-24 - open - 2 Sep 2014
avatar jissues-bot jissues-bot - change - 2 Sep 2014
Labels Added: ?
avatar zero-24 zero-24 - change - 2 Sep 2014
The description was changed
Rel_Number 4142
Relation Type Related to
avatar zero-24 zero-24 - change - 2 Sep 2014
Easy No Yes
avatar zero-24 zero-24 - change - 2 Sep 2014
The description was changed
avatar infograf768
infograf768 - comment - 3 Sep 2014

B/C issue imho.

avatar Bakual
Bakual - comment - 3 Sep 2014

B/C issue imho.

It indeed is. I already discussed some possible ways around it with @zero-24.
Most likely it means creating a new parameter for it while keeping the old one hidden. Then the code can check for the presence of the new one and if not uses the old existing one.

avatar zero-24
zero-24 - comment - 3 Sep 2014

@Bakual @infograf768 can you have again a look into this in case of B/C?

  • I have hidden the old value (field) and add a new for the ID
  • I have add some checks to the code. That should prefer the "old" value if it exists
  • Now we set the new url also to the "old" field if we have a new one.
avatar zero-24
zero-24 - comment - 3 Sep 2014
Other question

If this is B/C save would it be included in 3.3.x or as a new function to 3.4? (For the @since comments :D)

avatar Bakual
Bakual - comment - 3 Sep 2014

If this is B/C save would it be included in 3.3.x or as a new function to 3.4? (For the @since comments :D)`

It goes into 3.4 anyway because it has changed parameters and the like.

avatar zero-24
zero-24 - comment - 3 Sep 2014

ok @Bakual

after the last commit we do the the following

  • If a id exists --> use it
  • if no id exists --> test the old value
  • if the old value exists (and the url has not set) --> use the old value
  • if we have no id and no old value fall back and stay on the same page
avatar zero-24
zero-24 - comment - 3 Sep 2014

@hering can you have a test on this?

Here is a easy component that can help you
http://docs.joomla.org/Component_Patchtester_for_Testers

The easyest way to do is the following:
1. install com_patchster on a dev site (see link above)
2. apply the patch using com_patchtester (see the video)
3. test the options (dropdown) on the view
4. login and logout using the FE view.
5. report your results back here.

Note: If you still get redirect to a bad/old site please make sure that you choose a new login and logout page with the dropdown. As we use the old value if there is no now present.

Thanks

avatar phproberto
phproberto - comment - 3 Sep 2014

Personally I don't like this change. I agree that using a menuitem field would be better but I don't like the helper. This looks overcomplicated.

avatar zero-24
zero-24 - comment - 4 Sep 2014

@phproberto

Personally I don't like this change. I agree that using a menuitem field would be better but I don't like the helper. This looks overcomplicated.

ok. it is just a copy of the helper from mod_login
https://github.com/joomla/joomla-cms/blob/staging/modules/mod_login/helper.php

I only add some code to be B/C.

avatar zero-24
zero-24 - comment - 4 Sep 2014

@phproberto

I don't like the helper. This looks overcomplicated.

Please explain how we can have it easier/less complicated?

avatar zero-24 zero-24 - change - 27 Sep 2014
Category Components Front End
avatar zero-24
zero-24 - comment - 28 Sep 2014

@phproberto

Can you elucidate your comment e.g. with a better solution? I'm still open for any comment that make the code better :smiley:

avatar nicksavov nicksavov - change - 16 Oct 2014
Labels Added: ?
avatar catanet
catanet - comment - 17 Oct 2014

@test
Environment: Joomla! 3.3.6 with test data loaded
Step 1: I've followed the instructions and selected two already existing menus from the drop-downs, that pointed to articles. Login and logout work fine: the selected articles did appear.
Step 2: I've created a menu item with External URL, tested the menu item: working, selected in the drop-down of the login: error - 404 component not found.

User note: I find this patch useful, it makes the component more user friendly.


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

avatar brianteeman brianteeman - alter_testresult - 17 Oct 2014 - catnet: Tested successfully
avatar trangredweb trangredweb - test_item - 17 Oct 2014 - Tested successfully
avatar trangredweb
trangredweb - comment - 17 Oct 2014

@test

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

avatar brianteeman
brianteeman - comment - 17 Oct 2014

I am setting this to Needs Review based on the comments above by the PLT members so that they can make a final decision. Thanks for contributing and testing this issue

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

avatar brianteeman brianteeman - change - 17 Oct 2014
Status Pending Needs Review
avatar brianteeman brianteeman - change - 1 Jan 2015
Labels Removed: ?
avatar zero-24 zero-24 - close - 19 Jan 2015
avatar zero-24 zero-24 - close - 19 Jan 2015
avatar zero-24 zero-24 - change - 19 Jan 2015
Status Needs Review Closed
Closed_Date 0000-00-00 00:00:00 2015-01-19 08:53:38
avatar zero-24 zero-24 - head_ref_deleted - 19 Jan 2015

Add a Comment

Login with GitHub to post a comment