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.
When moving terms to new parents, we should invoke taxonomy_term_save instead of directly updating the database.
Patch to follow
Comment | File | Size | Author |
---|---|---|---|
#5 | taxonomy_manager-update_taxonomy_manager_move-1986420-1.patch | 1.6 KB | Anonymous (not verified) |
#1 | taxonomy_manager-update_taxonomy_manager_move-1986420-1.patch | 1.6 KB | Anonymous (not verified) |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedpatch is attached
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #3
apotek CreditAttribution: apotek commentedThis is a good point. A move operation currently doesn't allow any other module to hook into it. The two ways to deal with this as far as I can see, is to do what @SpaJenniOs is suggesting in her patch, which, by calling taxonomy_term_save(), will call all the following hooks:
which would allow other modules to interact with the move operation.
The other option is to modify the move function by making it create its own hooks that other modules can hook into, ie, put something like this in the function:
I think SpaJenniOs's solution is the preferable one since it relies on the taxonomy module's code and doesn't create a new hook, but if there is a reason taxonomy_term_save cannot be used, creating a hook for other module developers to use will work too.
@SpaJenniOs: If you roll this patch against the dev branch instead, I think you can get your patch into the testing bot.
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #6
mh86 CreditAttribution: mh86 commentedCommitted a slightly adapted version of #5. See http://drupalcode.org/project/taxonomy_manager.git/commitdiff/505c6eb
Thanks a lot for the patch.