Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#7 | taxonomy_menu-pass_term_to_hooks-2654262-7.patch | 552 bytes | jenlampton |
| |||
#6 | taxonomy_menu-hook-flexibility-improvements-6.patch | 1.82 KB | hanoii |
|
Comments
Comment #2
hanoiiA simple harmless one line patch.
Comment #3
hanoiiComment #4
hanoiiAlthough 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().
Comment #5
hanoiiComment #6
hanoiiComment #7
jenlamptonThis 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.
Comment #8
andrey.troeglazov CreditAttribution: andrey.troeglazov at DrupalJedi commentedComment #10
andrey.troeglazov CreditAttribution: andrey.troeglazov at DrupalJedi commented