I am working on a helper module that attempts to keep certain modifications to the menu in sync, like setting some menu item as hidden or adding a custom menu item whose parent is one of the taxonomy mapped ones.

For that, I was in the need of the $term object to detect name change. I could have stored it myself but I thought it was simply an unnecessary duplication of content, as you have the term object already.

Proposed solution is to pass on the $term object to this module's hooks.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hanoii created an issue. See original summary.

hanoii’s picture

Status: Active » Needs review
FileSize
606 bytes

A simple harmless one line patch.

hanoii’s picture

Title: Pass on the modified $term object to taxonomy_menu hoos » Pass on the modified $term object to taxonomy_menu hooks
hanoii’s picture

Title: Pass on the modified $term object to taxonomy_menu hooks » Pass on the modified $term object to taxonomy_menu hooks and $item to menu hooks
FileSize
1015 bytes

Although this addition is not necessary, right now, by my module, I do believe it's a handy think to have on as it could serve good purpose to other modules. Now also adding taxonomy menu $item to the link before calling menu_link_save().

hanoii’s picture

hanoii’s picture

Title: Pass on the modified $term object to taxonomy_menu hooks and $item to menu hooks » Improvements to allow modules to override more elements of the taxonomy_menu_item
FileSize
1.82 KB
jenlampton’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
552 bytes

This looks great, but some of the changes made to link options have already been accounted for in the 1.x branch. I've removed those changed and rerolled, the only addition here is passing the fully-loaded term along to hooks, as to prevent them from needing to load it again. This patch is RTBC from me, but could use a second review.

andrey.troeglazov’s picture

Issue tags: +Taxonomy menu release 7-1.6

andrey.troeglazov’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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