Success

User tests: Successful: Unsuccessful:

avatar tejaschavan724
tejaschavan724
21 Oct 2026

Pull Request resolves #48255.

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

When attempting to delete a menu that contains a home (default) menu item or checked-out items/modules, MenuType::delete() sets the error message by formatting JLIB_DATABASE_ERROR_DELETE_FAILED with \get_class($this) and Text::_('JLIB_DATABASE_ERROR_MENUTYPE'):

$this->setError(Text::sprintf('JLIB_DATABASE_ERROR_DELETE_FAILED', \get_class($this), Text::_('JLIB_DATABASE_ERROR_MENUTYPE')));

JLIB_DATABASE_ERROR_DELETE_FAILED is defined as "%s: :delete failed - %s". This causes the error banner in the administrator UI to expose internal implementation details:

Joomla\CMS\Table\MenuType: :delete failed - Some menu items or some menu modules related to this menutype are checked out by another user or the default menu item is in this menu.

This PR removes the redundant class name and method prefix wrapper, setting the error message directly as:

$this->setError(Text::_('JLIB_DATABASE_ERROR_MENUTYPE'));

This is consistent with how error messages are set throughout Joomla's Table classes and provides a clean, user-friendly message.

Testing Instructions

  1. In the Joomla Administrator, go to Menus -> Manage.
  2. Select a menu that contains a default/home menu item (e.g. Main Menu).
  3. Click the Delete button in the toolbar.
  4. Observe the error message banner displayed at the top of the page.

Actual result BEFORE applying this Pull Request

The message includes the internal PHP class name and method:

Joomla\CMS\Table\MenuType: :delete failed - Some menu items or some menu modules related to this menutype are checked out by another user or the default menu item is in this menu.

Expected result AFTER applying this Pull Request

The message is clean and user-friendly without technical debug prefixes:

Some menu items or some menu modules related to this menutype are checked out by another user or the default menu item is in this menu.

Link to documentations

Please select:

  • No documentation changes for guide.joomla.org needed
  • No documentation changes for manual.joomla.org needed
avatar tejaschavan724 tejaschavan724 - open - 21 Oct 2026
avatar chmst chmst - close - 26 Oct 2026
avatar chmst
chmst - comment - 26 Oct 2026

@tejaschavan724 thank you very much for our contribution. As 5.4 does not get improvements any more and the PR exists already for 6.3, I close it.
You surely will find other issues to solve!

Add a Comment

Login with GitHub to post a comment