joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

[5.1] Menu Item Plugin

Open brianteeman opened this issue 3 years ago • 29 comments

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

image

image

image

brianteeman avatar Nov 11 '22 09:11 brianteeman

conflicts resolved

brianteeman avatar Mar 01 '23 10:03 brianteeman

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.

HLeithner avatar May 08 '23 15:05 HLeithner

Would be nice to get some testers here as there were many people asking for this field

brianteeman avatar Jul 23 '23 15:07 brianteeman

@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".

richard67 avatar Jul 23 '23 17:07 richard67

@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

brianteeman avatar Jul 23 '23 18:07 brianteeman

This doesn't consider my concern about groupfieldlist, and the default_value === null for other field types. Or is this fixed in the meantime?

HLeithner avatar Jul 24 '23 06:07 HLeithner

Should we change the date to 2023?

chmst avatar Jul 24 '23 06:07 chmst

Should we change the date to 2023?

yes - I noticed it this morning over coffee and am doing it now

brianteeman avatar Jul 24 '23 07:07 brianteeman

Used the discover for a test and it works great. It needs test with fresh installation and update.

chmst avatar Jul 24 '23 11:07 chmst

thanks for testing. I would use this a lot with one of my custom components. Currently its an ugly sql field

brianteeman avatar Jul 24 '23 11:07 brianteeman

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 avatar Sep 15 '23 09:09 ceford

@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.

richard67 avatar Sep 15 '23 09:09 richard67

Conflicts now resolved

brianteeman avatar Sep 15 '23 09:09 brianteeman

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>

ceford avatar Sep 18 '23 09:09 ceford

This pull request has been automatically rebased to 5.1-dev.

HLeithner avatar Sep 30 '23 22:09 HLeithner

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.

viocassel avatar Nov 23 '23 08:11 viocassel

@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 avatar Nov 23 '23 10:11 richard67

@richard67 thanks for fixing the conflict - my available time is heavily restricted now. I have renamed the files

brianteeman avatar Nov 23 '23 10:11 brianteeman

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.

TLWebdesign avatar Feb 24 '24 09:02 TLWebdesign

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.

crimle avatar Feb 24 '24 10:02 crimle

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.

dorisdreher avatar Feb 24 '24 10:02 dorisdreher

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.

Heinz-R avatar Feb 24 '24 10:02 Heinz-R

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.

devcodemonkey avatar Feb 24 '24 10:02 devcodemonkey

RTC


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

richard67 avatar Feb 24 '24 10:02 richard67

@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.

richard67 avatar Feb 24 '24 22:02 richard67

P.S.: Or let me know if I shall do that for you, rename the update SQL scripts.

richard67 avatar Feb 24 '24 22:02 richard67

@richard67 my time in front of a computer is so restrictd right now could you do it please

brianteeman avatar Feb 25 '24 08:02 brianteeman

Done, update SQL scripts renamed to "5.1.0-2024-02-26.sql".

richard67 avatar Feb 25 '24 09:02 richard67

thanks @richard67

brianteeman avatar Feb 25 '24 09:02 brianteeman

wouyld be great ro get this really old feature finaly merged

brianteeman avatar Mar 13 '24 20:03 brianteeman