? ? ? Pending

User tests: Successful: Unsuccessful:

avatar roland-d
roland-d
11 Apr 2018

Summary of Changes

This change adds the behavior of being able to use a return URL on the Cancel button. This feature already exists on the Save & Close button and makes sense to me to add it to the other functions as well.

This is not something users will use manually but programmers can use it to make sure users go back to where they came from. It adds consistency to the workflow.

Testing Instructions

We are going to assume you reached the article via Banners

  1. Open an article in Content management
  2. Add &return=aW5kZXgucGhwP29wdGlvbj1jb21fYmFubmVycw== behind the URL
  3. Click Save & Close
  4. You are now on the Banner listing because that is the return URL used

Repeat step 1 & 2
3. Click Cancel
4. You are now on the Article listing instead of the Banner listing despite providing a return URL

Apply Patch

  1. Open an article in Content management
  2. Add &return=aW5kZXgucGhwP29wdGlvbj1jb21fYmFubmVycw== behind the URL
  3. Click Save & Close
  4. You are now on the Banner listing because that is the return URL used

Repeat step 1 & 2
3. Click Cancel
4. You are now on the Banner listing as expected due to the provided return URL

Expected result

After Cancel you end up where you started

Actual result

You end up at the Article listing

Documentation Changes Required

None

avatar roland-d roland-d - open - 11 Apr 2018
avatar roland-d roland-d - change - 11 Apr 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 11 Apr 2018
Category Libraries
avatar ggppdk
ggppdk - comment - 11 Apr 2018

Without testing

  • it looks good in case of cancel, we need to redirect back to the return url (after checking it)
  • but in case of save2new is it needed ? looking at the code (without testing) $this->getRedirectToListAppend() seems to already adding (passing) the return url,

also a little irrelevant but you would not verify it when just passing it, usually we would check it for being "internal" only before final usage ?

avatar roland-d roland-d - change - 12 Apr 2018
Labels Added: ? ?
avatar roland-d roland-d - change - 12 Apr 2018
Title
Add the return value to the Cancel and Save & New option
Add the return value to the Cancel option
avatar roland-d roland-d - edited - 12 Apr 2018
avatar roland-d roland-d - change - 12 Apr 2018
The description was changed
avatar roland-d roland-d - edited - 12 Apr 2018
avatar roland-d
roland-d - comment - 12 Apr 2018

@ggppdk Thank you for reviewing the code. You are correct, for Save & Close the change is not needed because the code is already in place there. I have updated the code and test instructions to reflect this.

also a little irrelevant but you would not verify it when just passing it, usually we would check it for being "internal" only before final usage ?

I am not sure what you are asking here. Are you talking about the isInternal check? That is just taken from how it is used in the Save action.

avatar ggppdk
ggppdk - comment - 12 Apr 2018

I am not sure what you are asking here. Are you talking about the isInternal check? That is just taken from how it is used in the Save action.

I meant (for the code that you have now removed) when appending the '&return' variable
'&return=' . $someurl, no need to check that someurl is internal

$return_url = $this->getInput(...);

// No need check return_url is internal, just append it
// it will be checked when it is time to be used (redirecting to it)
$this->setRedirect($someurl . '&return = ' . $url);

Like you correctly check it in cancel,
because we have reached the point that it will be used (redirecting to it)

avatar ggppdk
ggppdk - comment - 13 Apr 2018

I have tested this item successfully on d9e3f67

Also i see that custom article controller for frontend
(and also some controllers of 3rd party components)

already support using return url for the cancel task
so this is change is consistent, all core and 3rd party components using the default controller should benefit for this


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

avatar ggppdk ggppdk - test_item - 13 Apr 2018 - Tested successfully
avatar Quy
Quy - comment - 14 Apr 2018

I have tested this item successfully on d9e3f67


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

avatar Quy Quy - test_item - 14 Apr 2018 - Tested successfully
avatar Quy Quy - change - 14 Apr 2018
Status Pending Ready to Commit
avatar Quy
Quy - comment - 14 Apr 2018

RTC


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

avatar mbabker mbabker - change - 12 May 2018
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-05-12 18:40:35
Closed_By mbabker
Labels Added: ?
avatar mbabker mbabker - close - 12 May 2018
avatar mbabker mbabker - merge - 12 May 2018

Add a Comment

Login with GitHub to post a comment