Quantcast
Viewing all articles
Browse latest Browse all 296253

Generalize MenuLinkAdd so all local actions can use it

Problem/Motivation

So when defining a local action, you may specify a class to dynamically set some properties. A common use case is to slap on a 'destination' query parameter so people are redirected to the page the action was on after performing the action itself.

The menu_ui module already provides a class that does exactly that: \Drupal\menu_ui\Plugin\Menu\LocalAction\MenuLinkAdd. Why don't we generalize this class to core to something like: Drupal\Core\Menu\LocalActionWithDestination?

That way, all modules can use it without having to rely on menu_ui being enabled or having to duplicate the code.

Steps to reproduce

Not applicable.

Proposed resolution

Remaining tasks

Confirm the changes referred to at https://git.drupalcode.org/project/drupal/-/merge_requests/10366#note_41...

User interface changes

None.

Introduced terminology

None.

API changes

None.

Data model changes

None.

Release notes snippet

None.


Viewing all articles
Browse latest Browse all 296253

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>