Skip to content

Conversation

@hiteshm0
Copy link
Contributor

Pull Request for Issue #46472

Summary of Changes

When creating a menu item via "save to menu" from articles or categories, the menu type is preselected on page load. But, the parent item dropdown does not have any items. This is because the parent item dropdown is populated only when a change event is fired on a menu type field. And no change event occurs when the page is loaded with a preselected menu item.

Fix: Added initialization logic to check if a menu type is already selected on page load. If yes, then the onChange function is trigerred manually.

Testing Instructions

  1. Go to content → articles/categories
  2. Open/create any article/category
  3. Click save to menu button
  4. Check the parent item dropdown

Actual result BEFORE applying this Pull Request

Parent Item dropdown is empty

Expected result AFTER applying this Pull Request

Parent item dropdown has the correct items

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

@ceford
Copy link
Contributor

ceford commented Jan 5, 2026

I have tested this item ✅ successfully on 9e64196


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

@coolcat-creations
Copy link
Contributor

I have tested this item ✅ successfully on 8110997

Works as described and is very useful, thank you!


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

@richard67
Copy link
Member

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jan 9, 2026
@richard67 richard67 added this to the Joomla! 5.4.3 milestone Jan 9, 2026
@muhme
Copy link
Contributor

muhme commented Jan 12, 2026

✅ Final test before merge with JBT

  • It was difficult for me to reproduce the issue, but finally (perhaps after setting ‘Error Reporting’ to system default and disabling ‘Debug System’ and ‘Log Almost Everything’) I was able to reproduce the issue and saw that the list of parent menu items was empty and the suggested workaround of selecting a different menu was also reproduced.
  • PR installed with patch tester and npm run build:js
  • Successfully verified that the list of menu entries is loaded (in 'Save to Menu' for articles and in both 'Save to Menu as List' and 'Save to Menu as Blog' for categories). The list of parent menu items is always loaded with the correct entries.

@muhme muhme merged commit 7cbd3b9 into joomla:5.4-dev Jan 12, 2026
69 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Jan 12, 2026
@muhme
Copy link
Contributor

muhme commented Jan 12, 2026

Thank you @hiteshm0 for your contribution. Thank you @ceford and @coolcat-creations for testing.

@hiteshm0 hiteshm0 deleted the hiteshm0-issue46472 branch January 12, 2026 19:32
@heelc29
Copy link
Contributor

heelc29 commented Jan 12, 2026

@richard67 I think this PR is responsible for the recent failed system tests. I haven't investigated this further yet.
image

@richard67
Copy link
Member

@richard67 I think this PR is responsible for the recent failed system tests. I haven't investigated this further yet.

@heelc29 I think the same, but I also have not had time to investigate yet.

@hiteshm0 hiteshm0 restored the hiteshm0-issue46472 branch January 12, 2026 21:22
muhme added a commit to muhme/joomla-cms that referenced this pull request Jan 13, 2026
After merging of joomla#46621, Cypress System Tests fail more often (but not always)
with `(uncaught exception)TypeError: Cannot read properties of undefined (reading 'clearChoices')`.
However, investigations have shown that this also happened before, but not as often.
It appears that Cypress speeds up page loading and XHR timing, and with the newly added `onChange()`, this causes Cypress to fail with an uncaught exception.
This simple *hack* prevents the crash. If you have a better implemention, you are welcome to share it.
heelc29 added a commit to heelc29/joomla-cms that referenced this pull request Jan 13, 2026
@richard67
Copy link
Member

It seems this PR was not the right fix. Meanwhile there is a new one, see #46681 .

@richard67 richard67 removed this from the Joomla! 5.4.3 milestone Jan 13, 2026
muhme pushed a commit that referenced this pull request Jan 14, 2026
…e to menu' v2 (#46681)

* Remove wrong id from menu edit data
* Revert "[5.4] Fix: Parent menu items missing when creating menu item via Save to Menu (#46621)"
* This reverts commit 7cbd3b9.
@richard67 richard67 modified the milestone: Joomla! 5.4.3 Jan 14, 2026
@hiteshm0
Copy link
Contributor Author

sorry y'all 😅

@hiteshm0 hiteshm0 deleted the hiteshm0-issue46472 branch January 17, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug NPM Resource Changed This Pull Request can't be tested by Patchtester PR-5.4-dev

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants