Generalize MenuLinkAdd so all local actions can use it

Created on 7 July 2016, over 8 years ago
Updated 6 February 2023, over 1 year ago

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.

Feature request
Status

Needs work

Version

10.1

Component
Menu system 

Last updated about 22 hours ago

Created by

🇧🇪Belgium kristiaanvandeneynde Antwerp, Belgium

Live updates comments and jobs are added and updated live.
  • Needs change record

    A change record needs to be drafted before an issue is committed. Note: Change records used to be called change notifications.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States smustgrave

    This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.

    Maybe it's just me but if changing the class name couldn't that break existing sites?
    If so we would need a different approach, maybe we deprecate the old

    If not still think this could use a change record.

Production build 0.71.5 2024