User tests: Successful: Unsuccessful:
Pull Request resolves #19652
Changed the method populateState() in itemModel.php to setUserState ( menu type, client id via getUserStateFromRequest() ) only when a new menu item is being created.
Moved the database query responsible for fetching parent items for a menu item ( via getParentItem() in ItemController.php) from ItemsModel to a new method getParentItems() in ItemModel to prevent ItemsModel::populateState() from running which was unnecessarily updating the session state ( whenever the menutype of a menu item was changed an AJAX request was being handled by getParentItem() )
What this does is that when we edit a menu item and click on 'save and close' we will be redirected to the list view of menu items with the original menu type filter instead of it being set to the menu type of the article that was edited.
But when we create a new menu item the previous functionality is preserved.
Case 1: Editing
Case 2: Creating
Case 3: Editing ( change menu type )
get redirected to list view of menu items with the menu type filter set to the menu type of the article edited / created.
Case 1:
get redirected to list view of menu items with the original filter ( ie no filter ).
Case 2:
same as before
Case 3:
get redirected to list view of menu items with the original filter
Please select:
Documentation link for guide.joomla.org:
No documentation changes for guide.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
| Status | New | ⇒ | Pending |
| Category | ⇒ | Administration com_menus |
| Labels |
Added:
PR-5.4-dev
|
||
| Labels |
Added:
bug
|
||
I have tested this item ✅ successfully on 7aae034
I have tested this item ✅ successfully on 7aae034
I have tested this item ✅ successfully on 7aae034
I have tested this item ✅ successfully on 7aae034
@brianteeman @CSGoat0 Have you also tested cases 1 and 3 when at the beginning in step 1 a filter was set?
The testing instructions cover only the case that no filter was selected in that step.
But the expected result says the original filter shall be restored.
I would expect that to work with any filter and not only none.
Yes
| Status | Pending | ⇒ | Ready to Commit |
RTC
RTC
| Labels |
Added:
RTC
|
||
✅ Final test before merge with JBT
gh pr checkout 47202
| Status | Ready to Commit | ⇒ | Fixed in Code Base |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2026-07-18 16:08:21 |
| Closed_By | ⇒ | muhme |
Thank you very much @hiteshm0 for your contribution. Thanks to @richard67 and @QuyTon for support. Thanks to @CSGoat0 and @brianteeman for testing.
as getUserStateFromRequest() updates the session state, explicitly updating it later might be redundant
can a maintainer let me know what the ideal behavior for case 3 is ? ( i went through the conversation of the issue and could only find the desired behavior for case 1 and case 2 )
Currently, even if you change the menutype from 'X' to 'Y' and then immediately back to 'X' it still redirects back to list view with menu type filter set to 'X' and im not quite sure where the session state is getting updated for that to happen.