My UseCase is #2587503: Print module with erpal lists (eg tasks), where I setup a page callback mytask/%node, for printing purposes.
In this respect, I have to is to setup Context local actions and tabs to print/MyViewPath or printpdf/MyViewPath, provided by https://www.drupal.org/project/print
The problem is: Even in the interface at admin/structure/cat/edit/erpal_project_tasks I setup a link like printpdf/mytask/[erpal_project:nid] is trimmed to printpdf
At first glance, I blamed '#autocomplete_path' => 'cat/autocomplete' or some validations in cat module, but after some debugging I found the lines if (!($action_item = menu_get_item($path))) {
and
if (!($tab_item = menu_get_item($path))) {
I couldn’t use general hooks like hook_url_outbound_alter or hook_menu_get_item_alter, because there is no context available and this could affect all the drupal links related to print module, not only generated by cat module.
Also, the existing hook drupal_alter('cat_local_task_view', $menu_local_tasks);
, was too late in the function _cat_menu_local_tasks_alter, after all links are already themed.
That’s way I ended with these 2 new hooks.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | hooks_cat_action_and_tab_item_alter-2587509.patch | 1.29 KB | Drupa1ish |
Comments
Comment #2
Drupa1ish commented