[4.0] Load presets from component directory#27869
Conversation
|
One thing to think about is that all presets are currently using the same "namespace" (for lack of a better word). Which means if another component uses the same preset name as another (eg "default"), the first one gets overwritten. |
|
I have tested this item ✅ successfully on f81879a
But this is out of scope of this PR. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27869. |
|
I have tested this item ✅ successfully on f81879a This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27869. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27869. |
Pull Request for Issue #27765.
This tackles the issue that 3rd party components couldn't easily have presets menus (eg for the dashboard) like core components have.
Summary of Changes
Currently, the list of presets is hardcoded in the menuhelper. This PR changes this to a dynamically loaded list. It looks in each enabled component if there is a
presetsfolder and loads all XML presets found there.This also moves the existing component specific presets for com_content and com_users to their respective component folder, instead of having them in com_menus.
The language strings are taken out from mod_menu.ini and lib_joomla.ini and moved to the place where the corresponding presets lives, so either com_content, com_users or com_menu (for the "system" ones).
Testing Instructions
After applying the PR, check that the menu (main and alternative) and the various dashboards still work as expected.
To test 3rd party, you can copy an existing preset file to a 3rd party component and renamed it. Then see if it shows up in the presets list in the "Administrator Menu" and "Administrator Dashboard Menu" modules.
Or you can use my component and see if the "SermonSpeaker Dashboard" Preset comes up there.
com_sermonspeaker.zip
Expected result
Presets are loaded from component folders as well and all component specific assets (preset, language strings) are contained in the component folder.
Actual result
Presets are hardcoded in com_menus. Language strings reside in lib_joomla and mod_menu.
Documentation Changes Required
Probably in the 4.0 Component development guide.