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.
All entities in core should have hooks at all the places they invoke field_attach ops, otherwise there's an imbalance in the API.
I would've posted this earlier but I thought the hook existed already, then when I wanted it, it wasn't there :(
Comment | File | Size | Author |
---|---|---|---|
#12 | drupal-764726-12-add-in-hook-taxonomy-presave-D6.patch | 1.36 KB | mikeytown2 |
#11 | drupal-764726-D6.patch | 1.6 KB | mikeytown2 |
#10 | drupal-764726-D6.patch | 2.87 KB | mikeytown2 |
#8 | drupal-764726-D6.patch | 2.85 KB | mikeytown2 |
#7 | drupal-764726-D6.patch | 2.84 KB | mikeytown2 |
Comments
Comment #1
nagba CreditAttribution: nagba commented+1
Comment #2
Dave ReidComment #3
catchtaxonomy_term_presave.patch queued for re-testing.
Comment #4
webchickThis looks like it's pretty clearly an oversight in the existing API implementation, rather than a new addition, so committed to HEAD. Thanks!
Comment #6
mikeytown2 CreditAttribution: mikeytown2 commentedNeed to back port this for a shared taxonomy project/module. Patch to come soon, don't expect this to get into core, but since this is in 7.x I don't feel as bad hacking core. The module will be be released on d.o once I create it.
http://api.drupal.org/api/function/taxonomy_save_term/6
http://api.drupal.org/api/function/taxonomy_save_vocabulary/6
http://api.drupal.org/api/function/hook_taxonomy/6
Comment #7
mikeytown2 CreditAttribution: mikeytown2 commentedAdded in missing/better documentation for the above 2 functions.
Comment #8
mikeytown2 CreditAttribution: mikeytown2 commentedfixed a dumb error in the documentation
Comment #9
mikeytown2 CreditAttribution: mikeytown2 commentedlame... D6 uses arrays which do not get passed by reference, so this hook in its current form doesn't work for D6.
Comment #10
mikeytown2 CreditAttribution: mikeytown2 commentedDue to the requirement of a return value I'm no longer using hook_taxonomy. Using d7 naming conventions in d6.
hook_taxonomy_vocabulary_presave()
hook_taxonomy_term_presave()
Comment #11
mikeytown2 CreditAttribution: mikeytown2 commentedthis change is too big, putting this back to 7.x
Here is the patch I decided to use for 6.x though.
Comment #12
mikeytown2 CreditAttribution: mikeytown2 commentedRe-rolled #11 for git