Closed (fixed)
Project:
Drupal core
Version:
8.3.x-dev
Component:
documentation
Priority:
Minor
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
6 Feb 2017 at 07:55 UTC
Updated:
26 Feb 2017 at 15:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
alex_optimComment #3
alex_optimComment #4
vmachado commentedComment #5
vmachado commented@joachim
Please, could you add more details about what should be done in this issue?
Comment #6
joachim commentedSure.
The documentation for hook_menu_local_tasks_alter() mentions the function menu_local_tasks().
However, if you follow the link to read about menu_local_tasks(), you will see that it is marked as deprecated. That means that it shouldn't be used. The documentation for menu_local_tasks() unfortunately doesn't tell you what you should use instead. (Ideally it should, but that is another separate problem.)
The documentation for hook_menu_local_tasks_alter() therefore should be updated, so it refers to the new thing you should use instead of menu_local_tasks().
So the steps to fix are:
1. research what should be used instead of menu_local_tasks()
2. replace the mention of menu_local_tasks() with the new thing
Comment #7
anish.a commentedFound that
\Drupal\Core\Menu\LocalTaskManager::getLocalTasks()invokes this. Changed the documentation. Please review.Comment #8
joachim commentedGood detective work!
And patch looks perfect. Thanks!
Comment #9
xjmThere are several more docs references to this deprecated function that we should fix in the same patch:
For background information on why we should correct them all at once, see https://www.drupal.org/core/scope.
Thanks for working on this!
As a documentation fix only, the scope I've set can also be backported to 8.3.x.
Comment #10
joachim commentedLooks like the only other mention is this one:
> core/lib/Drupal/Core/Menu/menu.api.php: * This hook is invoked by menu_local_tasks(). The system-determined tabs and
All the others are hook_menu_local_tasks_alter() which is fine.
(I am starting to wonder whether we should make sure that patches that deprecate something also handle the docs clean-up, or do it as a separate preparatory issue...)
Comment #11
tameeshb commentedThe one replaced in #7 looks like the only one.
RTBC?
Comment #12
joachim commentedYup.
Comment #14
xjmNote that grepping for
menu_local_tasks()with closed parens is not sufficient, because the function call may be documented with arguments, in which case the parentheses may be separated, or as a callback, meaning no parentheses. So the remaining ones not caught by the grep in #11 are these:However, those are not actually documentation references. So indeed, the current patch works for the extended scope. Thanks for double-checking and sorry for the extra review!
We probably need a followup though to actually remove the places where it's being used as a theme function, so tagging for that.
By the way, for some info on how we will be changing our process on deprecation in the future, see:
We will also require full removals in advance of Drupal 9:
#2607260: [meta] Core deprecation message introduction, contrib testing etc.
Comment #16
tameeshb commented@xjm, I had thought of the params so I also grepped using, "menu_local_tasks(" but didn't know about the callback part without any parentheses, thanks :D