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.
Now that #306224: EOL Taxonomy sprint: add proper taxonomy term hooks is in, hook_taxonomy() (yes, it exists!) needs to become hook_taxonomy_vocabulary_load/save/delete/update
Comment | File | Size | Author |
---|---|---|---|
#5 | vocab-hooks-329140-4.patch | 18.84 KB | pwolanin |
#1 | vocabulary_hooks.patch | 11.44 KB | catch |
Comments
Comment #1
catchThis adds the hooks, and brings the function naming into line with #314147: DX: Standardise taxonomy load/save/delete functions on objects.
Comment #2
catchBetter description.
Comment #3
pwolanin CreditAttribution: pwolanin commentedLooks reasonable - will test.
Comment #4
pwolanin CreditAttribution: pwolanin commentedwe should abolish the possibility that taxonomy_vocabulary_save() will delete the vocabulary - what an abomination in any API. Also some problems like this w/ forum module needed fixing: Fatal error: Call to undefined function taxonomy_save_vocabulary() in forum.install
After testing - the above patch totally borks forum module due to the calling function not being able to get the vid back after saving a vocabulary.
Comment #5
pwolanin CreditAttribution: pwolanin commentedok, a more thorough cleanup - I think the vocabulary is now consistently treated as an object and the forum module and forum and taxonomy tests are unbroken.
Comment #6
catchMuch better. pwolanin went where I feared to tread in taxonomy.test. Nice find that it's the only place which uses the 'if the vocabulary name is empty, delete it', logic.
There's so, much, more, cleanup that needs to be done in taxonomy module. But let's get this in so we can keep going with it.
Comment #7
Dries CreditAttribution: Dries commentedLooks good, and tests pass. Committed to CVS HEAD. Thanks.
Comment #8
catchThanks Dries.
Marking to needs work since I need to fix update and API docs for this.
Comment #9
catchI've updated the core/hooks.php and the update documentation, so this back to fixed :)