In function taxonomy_save_term(), the modules' taxonomy hooks are invoked immediately after the term_data table has been updated, but before updating term_relation, term_hierarchy, and term_synonym.

This is inconsistent with term deletion, which updates all those tables before invoking the taxonomy hooks (and which I think is a nice behavior).

The current behavior causes me a problem in a custom module I am writing, where my taxonomy hook needs to check the parents of the term being updated. To work around this, I moved the hook invocation near the bottom of taxonomy_save_term().

This issue seem to apply to the CVS version as well.

CommentFileSizeAuthor
#3 taxonomy.module_27.patch1.24 KBDavid Lesieur
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chx’s picture

If you have solved the problem could you please roll a patch? Against HEAD, please. See the handbook on how to get HEAD and create a patch. Thanks.

magico’s picture

Is this still a problem?

David Lesieur’s picture

Version: 4.6.1 » x.y.z
Status: Active » Needs review
FileSize
1.24 KB

Yes, this is still a problem. Here is a patch. Thanks for reminding me...

AjK’s picture

Patch applied and seems ok. Didn't break anything that I could see.

Functionally this seems sensible so it's a +1 from me.

regards,
--AjK

AjK’s picture

Status: Needs review » Reviewed & tested by the community
drumm’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)