[5.4] Correct redirects when saving article in frontend#45254
[5.4] Correct redirects when saving article in frontend#45254AkameOuO wants to merge 4 commits intojoomla:5.4-devfrom
Conversation
|
Shouldn't this be in the ssave function of the article controller? |
|
I also tried that in the other branch. But I'm not sure which one is better. |
| <?php endif; ?> | ||
|
|
||
| <form action="<?php echo Route::_('index.php?option=com_content&a_id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="adminForm" class="form-validate form-vertical"> | ||
| <form action="<?php echo Route::_('index.php?option=com_content&a_id=' . (int) $this->item->id . ($menu ? "&Itemid={$menu->id}" : '')); ?>" method="post" name="adminForm" id="adminForm" class="form-validate form-vertical"> |
There was a problem hiding this comment.
| <form action="<?php echo Route::_('index.php?option=com_content&a_id=' . (int) $this->item->id . ($menu ? "&Itemid={$menu->id}" : '')); ?>" method="post" name="adminForm" id="adminForm" class="form-validate form-vertical"> | |
| <form action="<?php echo Route::_('index.php')); ?>" method="post" name="adminForm" id="adminForm" class="form-validate form-vertical"> |
Unfortunately you can't add the Itemid in this way and shouldn't really have to do that ever really. See above for a better solution. This will result in the current request being the form action.
|
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. |
|
@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. |
|
After I look further into this. I consider this is a side effect of #16756. |
|
#16756 is indeed about something similar I think. |
|
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? |
|
Excuse my ignorance, but what are the next steps? |
|
I have tested this item ✅ successfully on fbb04e3 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:
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 🔴 unsuccessfully on fbb04e3 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. So I add a new parameter 'return_itemid' to handle this. PS current patch is no longer use 'Create Artcle' menu item. |
| <?php endif; ?> | ||
|
|
||
| <form action="<?php echo Route::_('index.php?option=com_content&a_id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="adminForm" class="form-validate form-vertical"> | ||
| <form action="<?php echo Route::_('index.php?option=com_content&a_id=' . (int) $this->item->id . ($menu ? "&return_itemid={$menu->id}" : '')); ?>" method="post" name="adminForm" id="adminForm" class="form-validate form-vertical"> |
There was a problem hiding this comment.
Please use the return parameter which is already available here https://github.com/joomla/joomla-cms/pull/45254/files#diff-b8dc7a3e011b2f94a7f1f067499c396fda8eed7173a5343cf702e7deb52ce01bR308.
There was a problem hiding this comment.
The return parameter is for 'Save & Close' and 'Cancel' currently.
I don't have a good idea to make it support both 'return to edit page' and 'return to view page'.
There was a problem hiding this comment.
GitHub shows this review thread here as outdated due to the last branch update where I have solved a conflict in that line. But the comments here are still valid.
@laoneo Do you have an idea how he could do that, support both 'return to edit page' and 'return to view page'?
|
I have tested this item 🔴 unsuccessfully on 9879534 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 #45254 (comment) . 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 🔴 unsuccessfully on 9879534 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 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... |
|
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. |
Thanks for activating this PR correctly @richard67 |
|
This pull request has been automatically rebased to 5.4-dev. |
|
Please forgive my ignorance again, but does "Merge branch '5.4-dev' into fix-45238-2" mean this might be fixed and I can retest with "Joomla_5.4.1-dev+pr.45254"? |
|
@dpollez "Merge branch '5.4-dev' into fix-45238-2" means that the PR has been updated to the latest changes in its base branch 5.4-dev. |
|
Thanks richard67, clear to me now, too bad. Can I hope that someone will be working on it soon? |
|
Hello @laoneo, @richard67, @Hackwar, @joomdonation, @HLeithner, I'm a Joomla user (not a developer) who has been experiencing and testing this frontend article editing redirect issues. I have provided detailed test results with PDFs showing exactly what happens vs. what should happen for every action. The PR seems stuck on a technical design decision (according to claude.ai): Back on May 21, @AkameOuO said: "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." My simple question to the maintainers: Could you please advise @AkameOuO on which approach you prefer:
Once you give directions, I'm happy to help with: I understand you're all volunteers with limited time. I really appreciate any guidance you can provide so @AkameOuO or someone else can continue working on this. Thank you very much for your time and for all your work on Joomla! |






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
SaveandSave As Copywould redirect to home page.Expected result AFTER applying this Pull Request
SaveandSave As Copywould redirect to edit page.Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed