joomla-cms
joomla-cms copied to clipboard
[5.1] Menu Item Plugin
This is a combination of previously accepted pull requests #38244 and #38426 that were reverted due to misunderstanding.
Summary of Changes
All field types that joomla supports should be available via plugin to be used in custom fields.
adds a custom field to show a list of all menu items that can be selected and then displayed as a link in the frontend
Testing Instructions
Install a prebuilt package or Install this PR, discover the extension and publish the plugin
Create a menuitem custom field. Check that it shows all menuitems from all menus in the select ;ist and then check on the front end that the link is displayed.
Expected result AFTER applying this Pull Request



conflicts resolved
This pull request has been automatically rebased to 5.0-dev. No new features will be merged into Joomla! 4.3 series. Joomla! 4.4 series is a bridge release to make migration from Joomla! 4 to 5 as smooth as possible.
Would be nice to get some testers here as there were many people asking for this field
@brianteeman The update SQL scripts need to be renamed due to the rebase to 5.0. The new names should be e.g. "5.0.0-2023-07-23.sql".
@brianteeman The update SQL scripts need to be renamed due to the rebase to 5.0. The new names should be e.g. "5.0.0-2023-07-23.sql".
renamed
This doesn't consider my concern about groupfieldlist, and the default_value === null for other field types. Or is this fixed in the meantime?
Should we change the date to 2023?
Should we change the date to 2023?
yes - I noticed it this morning over coffee and am doing it now
Used the discover for a test and it works great. It needs test with fresh installation and update.
thanks for testing. I would use this a lot with one of my custom components. Currently its an ugly sql field
Testing, got as far as Create a menuitem custom field and got this after selecting the New button:
Fatal error: Class Joomla\Plugin\Fields\Calendar\Extension\Calendar contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Joomla\Event\SubscriberInterface::getSubscribedEvents) in /Users/ceford/Sites/joomla-cms/plugins/fields/calendar/src/Extension/Calendar.php on line 26
Uninstalled plugin, reverted patch and the New button works as normal. Work needed?
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39192.
@ceford Same thing: We have conflicts in the base.sql files for new installations, so when you are testing, the database might not fit. Please don't waste your time with testing PRs which have conflicts. As explained earlier by @brianteeman in another PR, you can see if a PR has conflicts on GitHub at the bottom of the PR.
Conflicts now resolved
I have tested this item :white_check_mark: successfully on 8b6d7f03dd5bd68fc8efb0ebb1b5e73fbde8fc4a
Front end text from test article:
Test 39192
Details
Written by: Cliff
Category: Uncategorised
Published: 18 September 2023
Hits: 2
Test 39192: Atomic
```<hr /><sub>This comment was created with the <a href="https://github.com/joomla/jissues">J!Tracker Application</a> at <a href="https://issues.joomla.org/tracker/joomla-cms/39192">issues.joomla.org/tracker/joomla-cms/39192</a>.</sub>
This pull request has been automatically rebased to 5.1-dev.
I have tested this item :white_check_mark: successfully on 8b6d7f03dd5bd68fc8efb0ebb1b5e73fbde8fc4a
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39192.
@brianteeman I've allowed myself to fix the conflict in the FieldsPlugin.php file. What remains to be done is to rename the update SQL scripts from "5.0.0-2023-09-15.sql" to the right version and a newer date, e.g. "5.1.0-2023-11-23.sql". Could you do that? Thanks in advance.
@richard67 thanks for fixing the conflict - my available time is heavily restricted now. I have renamed the files
I have tested this item :white_check_mark: successfully on 9c8a2b5a96461a78a6f79e15e405564eb780f1b1
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39192.
I have tested this item :white_check_mark: successfully on 9c8a2b5a96461a78a6f79e15e405564eb780f1b1
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39192.
I have tested this item :white_check_mark: successfully on 9c8a2b5a96461a78a6f79e15e405564eb780f1b1
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39192.
I have tested this item :white_check_mark: successfully on 9c8a2b5a96461a78a6f79e15e405564eb780f1b1
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39192.
I have tested this item :white_check_mark: successfully on 9c8a2b5a96461a78a6f79e15e405564eb780f1b1
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39192.
RTC
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39192.
@brianteeman Please rename the update SQL scripts from "5.1.0-2023-11-23.sq" (mind the missing "l" at the end of the extension) to something newer than "5.1.0-2024-02-10.sql", which is the latest update SQL present in the 5.1-dev branch. I suggest to use "5.1.0-2024-02-26.sql" because "5.1.0-2024-02-24.sql" and "5.1.0-2024-02-25.sql" will be used by other PRs.
It will not required new human tests, but the PR should not be merged as it is. With the extension "sq" instead of "sql" the scripts will never be run.
Thanks in advance.
P.S.: Or let me know if I shall do that for you, rename the update SQL scripts.
@richard67 my time in front of a computer is so restrictd right now could you do it please
Done, update SQL scripts renamed to "5.1.0-2024-02-26.sql".
thanks @richard67
wouyld be great ro get this really old feature finaly merged