Follow up for #1871772-108: Convert custom blocks to content entities
Problem/Motivation
+++ b/core/modules/block/custom_block/custom_block.module
@@ -5,29 +5,129 @@
+function custom_block_menu_local_tasks_alter(&$data, $router_item, $root_path) {
...
+ if (substr($root_path, 0, 26) == 'admin/structure/block/list') {
...
+ $path_map = explode('/', $root_path);
I just left some remarks in IRC that this implementation of hook_menu_local_tasks_alter() is one of the most complex I've ever seen and that I'm absolutely confident that it can be vastly simplified.
But that's straight refactoring/simplification, so can happen later. :)
That said, in case #1864066: Simplify hook_menu_local_tasks() and MENU_DEFAULT_LOCAL_TASK usage will land first, this hook needs to be adjusted to be not an alter hook, since it adds a local task (instead of altering an existing).
Proposed resolution
Refactor custom_block_menu_local_tasks_alter() once #1864066: Simplify hook_menu_local_tasks() and MENU_DEFAULT_LOCAL_TASK usage lands
Remaining tasks
Write patch