hook_taxonomy_term_insert() and hook_taxonomy_term_update() are backwards. Here is a simple patch to fix them but we should also create a test to make sure this doesn't happen in the future.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | taxonomy-term-test.patch | 7.02 KB | dropcube |
| #5 | taxonomy-term-test.patch | 7.02 KB | dropcube |
| #3 | taxonomy-term-test.patch | 7.01 KB | dropcube |
| taxonomy_hooks_backwards.patch | 1 KB | tylor |
Comments
Comment #1
dries commentedThe test bot hasn't run yet, but this looks like an obvious fix. Committed.
Comment #2
damien tournoud commentedLet's write some tests for that.
Comment #3
dropcube commentedTests for taxonomy terms hooks are there, but the way taxonomy_test.module implement those hooks, doesn't cover bugs like this one.
The attached patch update the taxonomy_test.module, to fix the implementations of taxonomy terms hooks and simplify them.
Instead of having one-to-many relationship of term-antonyms, is simplest to have one-to-one relationship, it's just a test module.
Comment #4
catchA few tabs crept into the patch:
Comment #5
dropcube commentedFixed.
Comment #6
catchstill some tabs here, and the fetchField() should be indented the same as the other chained methods. Otherwise looks RTBC.
Comment #7
dropcube commentedComment #8
catchComment #9
webchickExcellent! Committed to HEAD.
Comment #10
tylor commentedThis is great, thanks dropcube! Wishing I could have helped with writing but wasn't sure where to start ;)