? ? Pending

User tests: Successful: Unsuccessful:

avatar nikosdion
nikosdion
27 Dec 2021

Summary of Changes

Fixes the Components Dashboard to work equivalently to the backend Main Menu with regards to uninstalled / disabled components.

Testing Instructions

  • Install a component, ANY component, e.g. JCE, com_weblinks, whatever.
  • Delete the #__extensions record of the component to simulate a botched component uninstallation which leaves the component menu items behind

Actual result BEFORE applying this Pull Request

The main menu (sidebar) does not display links to the component.

However, the Components Dashboard (four squares icon next to the “Components” menu item name in the main menu) displays the missing component's links, untranslated. Clicking on them results in a 404 Component Not Found error page as expected.

Expected result AFTER applying this Pull Request

The main menu (sidebar) does not display links to the component.

The Components Dashboard (four squares icon next to the “Components” menu item name in the main menu) does not display links to the component.

Documentation Changes Required

None.

Further information

This problem was observed on a live site a while after after we uninstalled a (paid) extension. Due to an internal error in the extension's script the uninstallation didn't complete. Unbeknownst to us at the time, the extension record was removed from the #__extensions table, the files were removed from the filesystem BUT the #__menu records were left behind.

We didn't think much of this uninstallation issue until a few weeks later when we started doing the final, detailed inspection of the site to get it ready for delivery. @crystalenka noticed that the Components Dashboard would display links to the extension whereas the sidebar Main Menu wouldn't. I took a 5' look and found the discrepancy between how mod_submenu and mod_menu post-process the loaded menu items. This PR addresses this discrepancy.

No, the offending component was NOT mine, NEITHER was it JCE or WebLinks. :trollface: In any case the problem is not extension-specific, it can happen if the uninstallation is interrupted before the #__menu entries are removed for any reason.

Ideally, the common post-processing logic should be moved outside of Joomla\Module\Submenu\Administrator\Menu\Menu and Joomla\Module\Menu\Administrator\Menu\CssMenu and into Joomla\Component\Menus\Administrator\Helper\MenusHelper so it can be reused by third party menu modules.

Please note that this is supposed to be my week off. I may not be very responsive until January 3rd when I'm back at the office. I don't even know how I got suckered into fixing this in my week off. Something something something can't say no to my wife and Joomla being Hotel California... Anyway, Merry Christmas / Happy Holidays and Happy New Year, y'all!

avatar nikosdion nikosdion - open - 27 Dec 2021
avatar nikosdion nikosdion - change - 27 Dec 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 27 Dec 2021
Category Modules Administration
avatar nikosdion nikosdion - change - 27 Dec 2021
Labels Added: ?
avatar toivo toivo - test_item - 27 Dec 2021 - Tested successfully
avatar toivo
toivo - comment - 27 Dec 2021

I have tested this item successfully on 27bbd5b

Tested successfully in 4.06-dev using PHP 8.0.13


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

avatar crystalenka crystalenka - test_item - 28 Dec 2021 - Tested successfully
avatar crystalenka
crystalenka - comment - 28 Dec 2021

I have tested this item successfully on 27bbd5b


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

avatar richard67 richard67 - change - 28 Dec 2021
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 28 Dec 2021

RTC


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

avatar wilsonge wilsonge - close - 29 Dec 2021
avatar wilsonge wilsonge - merge - 29 Dec 2021
avatar wilsonge wilsonge - change - 29 Dec 2021
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-12-29 00:45:14
Closed_By wilsonge
Labels Added: ?
avatar wilsonge
wilsonge - comment - 29 Dec 2021

Thanks!

Add a Comment

Login with GitHub to post a comment