User tests: Successful: Unsuccessful:
This pull requests makes it possible to use the redirect form field when editing an item to allow the user to be redirected to the given URL after closing the item. For example when you have a link to a Joomla article within your own extension, you can set the return URL and after saving the article the user is redirected back to where he/she came from.
This change doesn't only affect Joomla articles but anybody implementing the return feature can use it.
http://joomla.dev/administrator/index.php?option=com_content&task=article.edit&id=89&return=aW5kZXgucGhwP29wdGlvbj1jb21fYmFubmVycw==
The expected result is that when the return value is set in the URL, it is applied to the form.
The supplied return URL is not set in the form.
None
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
@franz-wohlkoenig inspect element and search for aW5kZXgucGhwP29wdGlvbj1jb21fYmFubmVycw I guess
I have tested this item
Patch works as expected. Before patch applied I will not return to given page (com_banners) and after the patch I do return to the given page.
@franz-wohlkoenig @hans2103 is correct. You can do Inspect Element from your browser to find the field. I update the instructions accordingly.
thanks for Hints. Cant find in DevTools aW5kZXgucGhwP29wdGlvbj1jb21fYmFubmVycw or <input name="task" or <textarea like shown in Screenshot.
@franz-wohlkoenig Here are some more screenshots, hope that helps.
I guess you should scroll down to almost the end of the document to see this.
Honestly I doubt this is a good idea.
If I remember right, we do some checks on redirect URLs to make sure you can't be redirected to an external URL this way. Someone from JSST should at least have a look at it to make sure we don't introduce issues. @SniperSister
at a minimum i would think we would need to ensure that the redirect is an internal url
Labels |
Added:
?
|
@brianteeman Good point about the internal check. I have added the check to make sure the redirect URL is internal.
@Bakual The same functionality exists in the frontend, so I fail to see how this is worse than having it in the frontend.
@franz-wohlkoenig What if you just look at the source of the page? You can right click the page and select View Page Source. On that tab that opens you can search for name="return"
. Does that work for you?
The same functionality exists in the frontend, so I fail to see how this is worse than having it in the frontend.
If you check and only allow internal URLs, then it should be fine I guess. But then I don't understand your comment, this is a library controller class. That one is used both in frontend and backend.
The only place I found where we currently use that code is \ContentControllerArticle::getReturnPage and there we check if it is internal as well.
If we add this to JControllerForm, shouldn't the frontend ContentControllerArticle class then be adjusted? The current code seems to be redundant then to me as it does the same the parent class already will do after this PR?
I have tested this item
@roland-d Source Code works. Tooks Time to understand where to look.
If we add this to JControllerForm, shouldn't the frontend ContentControllerArticle class then be adjusted?
I don't see why because it routes differently. The getReturnPage() has a hardcoded redirect to JUri::base() if no return is set. This is not what you want in the backend if you ask me.
The current code seems to be redundant then to me as it does the same the parent class already will do after this PR?
This method already calls the parent but redirects in other ways than the parent does.
The only thing I see that is weird is this piece of code which is unrelated to my change:
$return = base64_encode('index.php?Itemid=' . $menuitem . $lang);
// If ok, redirect to the return page.
if ($result)
{
$this->setRedirect(JRoute::_(base64_decode($return)));
}
Why are we even encoding?
I don't see why because it routes differently. The getReturnPage() has a hardcoded redirect to JUri::base() if no return is set. This is not what you want in the backend if you ask me.
Ah true. Makes sense.
Why are we even encoding?
I gave up trying to understand all our code after I saw com_tags
PR ready for RTC?
Category | Libraries | ⇒ | Front End com_content Libraries |
Fine from me.
There was only one test after he added the internal check, and there was another commit after that one as well (allthought that one is safe for sure). So by our rules we would need at least one more test.
I have tested this item
I can confirm the I get the actual result without the patch and the expected result with the patch.
Status | Pending | ⇒ | Ready to Commit |
RTC after two successful tests.
I have tested this succesfully.
I have tested this item
I can confirm that the return argument is not included, while it is included when the patch has been applied.
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-06-21 18:37:37 |
Closed_By | ⇒ | rdeutz | |
Labels |
Added:
?
|
where to find the return Field of Step 3?