- 🇮🇳India sahil.goyal
Trying to fix CCF errors, Facing some difficulties to create interdiff, So here i updating the patch alone.
- Status changed to Needs review
about 2 years ago 3:25pm 8 February 2023 - Status changed to Needs work
about 2 years ago 3:58pm 8 February 2023 - 🇫🇷France andypost
+++ b/core/lib/Drupal/Core/Menu/LocalActionDefault.php @@ -37,11 +45,18 @@ class LocalActionDefault extends PluginBase implements LocalActionInterface, Con + @trigger_error('The redirect.destination service must be passed to LocalActionDefault::__construct(), it is required before Drupal 10.0.0.', E_USER_DEPRECATED); +++ b/core/modules/menu_ui/src/Plugin/Menu/LocalAction/MenuLinkAdd.php @@ -10,6 +10,10 @@ + * @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use the @@ -35,6 +39,7 @@ class MenuLinkAdd extends LocalActionDefault { + @trigger_error("\Drupal\menu_ui\Plugin\Menu\LocalAction\MenuLinkAdd is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use the 'add_destination: true' option in declaration of action links.", E_USER_DEPRECATED);
deprecated in 10.1.0, removed from 11.0.0
- Status changed to Needs review
about 2 years ago 5:08am 9 February 2023 - 🇮🇳India mrinalini9 New Delhi
Updated patch #51 by addressing #53, please review it.
Thanks & Regards,
Mrinalini - 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
Reviewing for the 'Needs framework manager review' tag.
I would implement this differently
- Firstly, copy MenuLinkAdd to Drupal\Core\Menu\LocalActionWithRedirect or similar
- Secondly, gut MenuLinkAdd and have it extend the new class, and retain the deprecation error
- Then instead of adding a new property to the yaml, for the links that need this, just add
class: Drupal\Core\Menu\LocalActionWithRedirect
This avoids needing to add a new property and just uses the plugin system we already have.
Thoughts?
- Status changed to Needs work
about 2 years ago 5:58pm 3 March 2023 - 🇺🇸United States smustgrave
Like the idea of #55 also.
Moving to NW for those changes. Also issue summary should be updated to match new proposal.
- 🇧🇪Belgium gorkagr
Hi!
I like the idea of #55 as using a class called LocalActionWithRedirect is more intuitive than MenuLinkAdd.
On the other hand, in the documentation (a bit outdated), it is written in both menu.links → and local.tasks → examples of how to use the 'options' within the yml, and:
options: query: destination: '/path/to/route'
can be defined if we need a destination different than the same route (which is added by default when using the class).
But nothing is documented in the links.actions page
Best
- 🇦🇺Australia sime Melbourne
Yes, per #59 if you do this code below then the current implementation of
MenuLinkAdd
will clobber this./** * Implements hook_menu_local_actions_alter(), */ function MYMODULE_menu_local_actions_alter(&$local_actions) { if (isset($local_actions['foo.bar'])) { $local_actions['foo.bar']['options']['query']['destination'] = '/cheese'; } }