User tests: Successful: Unsuccessful:
Pull Request resolves #48255.
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.
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.
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.
Please select:
@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!