joomla-cms
joomla-cms copied to clipboard
[5.3] Correct redirects when saving article in frontend
Pull Request for Issue #45238 .
Summary of Changes
Add Itemid in action of edit article form.
Testing Instructions
See original issue.
Actual result BEFORE applying this Pull Request
Save and Save As Copy would redirect to home page.
Expected result AFTER applying this Pull Request
Save and Save As Copy would redirect to edit page.
Link to documentations
Please select:
-
[ ] Documentation link for docs.joomla.org:
-
[x] No documentation changes for docs.joomla.org needed
-
[ ] Pull Request link for manual.joomla.org:
-
[x] No documentation changes for manual.joomla.org needed
Shouldn't this be in the ssave function of the article controller?
https://github.com/joomla/joomla-cms/blob/f60f51c99228e9be27d8026d62b2117faa1b1124/components/com_content/src/Controller/ArticleController.php#L341
I also tried that in the other branch. But I'm not sure which one is better.
https://github.com/AkameOuO/joomla-cms/commit/f3db68ae847b0c241488860171dd525438c9614a
Is this PR ready for test – asking because of comment.
Problem apparently not solved with the update, the behavior of the different actions (save, save and close...) remain unchanged. I downloaded file Joomla_5.3.0-beta4-dev+pr.45254-Development-Update_Package.zip And applied the update to the same Joomla minimal test site. The Joomla version indicates 5.3.0-beta4-dev+pr.45254 I do notice that as a result of the update an override has been changed on Cassiopeia Details and Files but I had not created any overrides and I do not suspect that this is a problem (file /templates/cassiopeia/html/com_content/form/edit.php). Tested on Edge and Chrome, cleared cache etc.
@dpollez The Pull Request is marked as "Draft" (you can see this as th PR has now a grey colour below the title and the word "Draft"). This means the PR is not ready for test.
Sorry, I found that I didn't consider some of situation. But I don't have time for this until next week.
OK, thanks for all your great work. My first issue post, don't know the rules yet. Had put my test a day earlier in my original post #45238, saw no response and then finally came to the right place here.
After I look further into this. I consider this is a side effect of #16756. Pushed a commit to revert that. Just to test for any other possible problems.
#16756 is indeed about something similar I think. I'm not used to the Joomla issue/bug process yet, can you please let me know when and with which update I can test again? Thanks!
No files to download yet...
@dpollez Prebuilt packages are now available.
I tested Joomla_5.3.1-dev+pr.45254 in a minimal test environment and the results are still incorrect and very confusing. This (normal) method continues to cause problems.
However, these confusing redirects can now be avoided by providing a (hidden) Create Article menu item but not using this menu item. See the results below.
Also, the submission/cancel redirects of menu-item Create Article are not respected. This is actually very good if the standard New Article button on the blog and list view pages is used, as in my test and as probably is most used.
But if the Create Article menu-item is used, it would be better if those redirects work correctly, without affecting the redirects of the standard New Article button.
Thanks for the great work, how will this be continued?
Summary of test results:
Excuse my ignorance, but what are the next steps?
I have tested this item :white_check_mark: successfully on fbb04e3cd2a089f64216b3e8844e5791fc0ab8df
I tested this on Firefox, Chrome and Edge and it worked.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45254.
@dpollez Are you requesting for further changes? Otherwise, please submit your test result here: https://issues.joomla.org/tracker/joomla-cms/45254
The Joomla_5.3.1-dev+pr.45254 change allows you to set up a coherent front-end modification. However, you must provide a hidden “create-article” menu item for this and not use this menu item itself. This actually gets around the original problem #45238. See tests 2 and 3 below (same tests as #45254).
But that original problem #45238 is still there, see test 1 below.
When modifying an article, you expect to stay in the same menu item after each action, even if no hidden “create-article” menu item is provided. However, this is only true after the “Save & Close” and “Cancel” actions. However, after “Save”, “Save as copy” or “Restore Version” you end up on the Home page and thus in an often totally different environment. This is very confusing and rectifying this seems useful.
A final redirect problem occurs when using the “create-article” menu item. The “submit” and “cancel” redirects of this menu item are not respected, see test 4. This would be better, of course, without changing the redirects of the default “New Article” button on blog and list view pages.
In short, what can be improved:
-
Make redirects at Edit also work correctly without a hidden “create-article” menu item.
-
Respect the “submit” and “cancel” redirects of a “create-article” menu item without impacting the redirects of the default “New Article” button on blog and list view pages.

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45254.
Silent here, I hope this will be followed up?
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45254.
@dpollez Was your 2nd last comment just a wish for improvement? Or was it a negative test result? If the latter, then maybe you should go to the issue tracker here https://issues.joomla.org/tracker/joomla-cms/45254 and use the blue "Test this" button and submit an unsuccessful test.
I have tested this item :red_circle: unsuccessfully on fbb04e3cd2a089f64216b3e8844e5791fc0ab8df
See my response on 25/4/2025
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45254.
@AkameOuO your branch is out-to-date and there are some unsolved comments, are you still working on it?
I closed this accidentally.
Multiple menu items can point to the same page.
It is hard to know the previous page in ArticleController::save without passing the correct 'Itemid' with the form.
So I add a new parameter 'return_itemid' to handle this. When the task is 'save2copy' or 'apply', and 'return_itemid' exists, it will be used as the 'Itemid' for redirect.
PS current patch is no longer use 'Create Artcle' menu item.
I have tested this item :red_circle: unsuccessfully on 9879534a3c5440c31bb057dccf6b489999c30770
I tested version Joomla_5.3.1-rc2-dev+pr.45254 in a minimal test environment and the results are worse than version Joomla_5.3.1-dev+pr.45254, partly to be expected given the comment "PS current patch is no longer use ‘Create Artcle’ menu item."
The “submit” and “cancel” redirects of a “create-article” menu item are also still not respected.
See results below.

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45254.
I am unable to replicate latest test result by https://github.com/joomla/joomla-cms/pull/45254#issuecomment-2901132001 .
And I cannot make the return parameter save both 'url before edit' and 'url of edit'. Unless I change it by javascript when submit the form.
I have tested this item :red_circle: unsuccessfully on 9879534a3c5440c31bb057dccf6b489999c30770
I did a completely new test departing from a new Joomla 5.3.0 installation and the results are much better but with still some consistent errors: everywhere at Restore version and many errors at Create Article from a menu-item.
If those errors can be fixed, this is a perfect solution!
The reason for the difference with the previous test was that there I had 5.3.1-rc2-dev+pr.45254 installed on top of 5.3.1-dev+pr.45254. I didn't think this would cause problems, sorry about that
See test results.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45254.
Will there be a sequel to this and what else can I possibly do?
Hello everyone,
I am not a developer, just a satisfied Joomla user. So please forgive my ignorance and lack of Github/Joomla knowledge, but this is getting a bit too much for me. The problem with front-end creating and editing articles is very confusing.
I reported this with issue #45248 on March 28, 2025 and others have reported it before. @ghost informed me that this was a duplicate of issue #45238, so I closed issue #45248.
Issue #45238 has already been closed, but I think PR #45254 stems from it.
@richard67 reports in PR #45254 that this is similar to PR #45619, so I tested this issue further on PR #45619.
What should I do now? PR #45254 is still open. I last tested on May 28, 2025, and the issue was almost resolved, but PR #45254 is at a standstill... because it was referred to PR #45619...
This message is posted on PR #45254 and #45619.
I've just updated this PR to the latest changes in the base branch (5.3-dev), which include the merged PR #45619 , so this PR here is ready again for testing.
Extensive testing with very confusing results, not good, see below.
The only workable scenario is using a hidden "Create Article" menu item and still using the standard New Article key. In that case, only Restore Version fails completely.
Member
** richard67 **
Thanks for activating this PR correctly @richard67 Will this be followed up further, and can I hope these bugs will be fixed in the next Joomla release?
This pull request has been automatically rebased to 5.4-dev.