Project:Taxonomy menu
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

I'm wondering if anyone has had any luck using the _taxonomy_menu_insert or _taxonomy_menu_update hooks? When I implement them in a custom module the menu items don't work, ie links are not created when the menu is rebuilt.

The problem seems to be that (line 423, taxonomy_menu.module)


  //let other modules make edits
  $item = module_invoke_all('taxonomy_menu_'. $op, $item);

returns a merged array of $items which the later code cannot understand.

So instead of an array like

$item
  tid => 168

we get an array of the form
$item
  tid
    0 => 168
    1 => 168

I'm thinking that module_invoke_all is the wrong thing to use in this case, and it would work if $item was just passed by reference to each module implementing the hook?

Could write up a patch for this if I'm not completely off track.

Thanks,

Mark

Comments

#1

I use the hooks in the original module, but only once. I guess when you use it more then once you get that array.

Kind of link an _alter hook... interesting. I think that fits the vision better also.

Go for the patch!

#2

Status:active» needs review

Ok, here's a patch which is working for me. Haven't used this structure before

    $function = $module .'_'. $hook;
    $function($item);

but it seems to call the required functions ok.

AttachmentSizeStatusTest resultOperations
taxonomy_menu-446714.patch1.13 KBIgnored: Check issue status.NoneNone

#3

Status:needs review» reviewed & tested by the community

Commited to Latest DEV

#4

Status:reviewed & tested by the community» fixed

Added to 2.4-beta1.

#5

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here