- πΊπΈUnited States smustgrave
Same as π Rename hook_menu_local_actions_alter() to hook_local_actions_alter() Needs work can we update the MR for 10.1 please
- πΊπΈUnited States JonMcL Brooklyn, NY
Working well for us. We are using this to set a specific route parameter based on external information:
/** @var \Drupal\Core\Url $url */ $url = &$local_actions['local_action.id']['#link']['url']; $url->setRouteParameter('node', $node->id());
A word to the wise: don't be like me and remember that you may likely need to have a method of invalidating the cache for this rendered item.
- First commit to issue fork.
- last update
almost 2 years ago 29,300 pass - Status changed to Needs review
almost 2 years ago 8:43pm 20 April 2023 - Status changed to Needs work
almost 2 years ago 12:00am 23 April 2023 - πΊπΈUnited States smustgrave
Appears this was just a copy but not updated for 10.1 but should be simple.
- π«π·France duaelfr Montpellier, France
duaelfr β changed the visibility of the branch 2585169-alter-local-actions-render to hidden.
- Merge request !10284Issue #2585169: Unable to alter local actions prior to rendering β (Open) created by duaelfr
- π«π·France duaelfr Montpellier, France
I rerolled !3858 into a new MR based on 11.x.
I converted procedural hooks to object ones.Attached: patches for composer
- π«π·France andypost
+++ b/core/lib/Drupal/Core/Menu/LocalTaskManager.php @@ -361,7 +361,8 @@ public function getLocalTasks($route_name, $level = 0) { + $this->moduleHandler->alterDeprecated('Deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use local_tasks_render instead. See https://www.drupal.org/node/3216578.', 'menu_local_tasks', $this->taskData[$route_name], $route_name, $cacheability); +++ b/core/lib/Drupal/Core/Menu/menu.api.php @@ -310,6 +310,10 @@ function hook_menu_links_discovered_alter(&$links) { + * @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use + * hook_local_tasks_render_alter instead.
version needs update to 11.2=>12.0
- π«π·France duaelfr Montpellier, France
@andypost Feedback addressed, thanks.
- π«π·France andypost
Added suggestion to format deprecation message (link should not have dot at the end)
And it needs deprecation test to make sure backward compatibility works but throws deprecation
- π©πͺGermany berliner
I don't have time to look at the MRs and update them, but I have re-rolled https://git.drupalcode.org/project/drupal/-/merge_requests/744 for 10.3.x. I'll upload that as a patch file for now.
- π«π·France duaelfr Montpellier, France
@andypost I accepted your suggestion an rebased the branch on 11.X
I have no idea how to write the deprecation test, though. Would you guide me, please? - π«π·France duaelfr Montpellier, France
Here are updated patches for composer
- π¬π§United Kingdom oily Greater London
@duaelfr Regarding the deprecation test: https://www.drupal.org/about/core/policies/core-change-policies/how-to-d... β . You can search recursively through the core folder for the string '@Group legacy' to find existing deprecation tests.
- π«π·France duaelfr Montpellier, France
Patch for composer with latest changes