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
Comment #1
indytechcook commentedI 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!
Comment #2
muhleder commentedOk, here's a patch which is working for me. Haven't used this structure before
but it seems to call the required functions ok.
Comment #3
indytechcook commentedCommited to Latest DEV
Comment #4
indytechcook commentedAdded to 2.4-beta1.