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.
Currently, taxnomy_node_get_terms() only respects the given key the first time it is called for a specific node. The second time, no matter what key is given, it will use the same key. This is because the static variable in which it is cached, is only cached by nid, and not by the key.
Patch is attached. It has a simple and clean solution IMO.
Comment | File | Size | Author |
---|---|---|---|
#4 | taxonomy_node_get_terms_key_0.patch | 1.04 KB | Wim Leers |
#3 | taxonomy_node_get_terms_key_HEAD_0.patch | 1.08 KB | Wim Leers |
#2 | taxonomy_node_get_terms_key_HEAD.patch | 1.06 KB | Wim Leers |
taxonomy_node_get_terms_key.patch | 1.02 KB | Wim Leers | |
Comments
Comment #1
chx CreditAttribution: chx commentedNice catch but we usually fix HEAD first and port down.
Comment #2
Wim LeersIn my excitement of finding my very first Drupal Core bug, I forgot to check HEAD first :P But since it's so trivial, here's the patch for HEAD already. Now you can commit both :)
Comment #3
Wim LeersOops! My superhandy new patch-generating tool did not take the paths into account.
Fixed patch for HEAD attached, 5.1 will follow.
Comment #4
Wim LeersAnd the updated patch for 5.1.
Comment #5
Dries CreditAttribution: Dries commentedGood catch. Committed to CVS HEAD, but needs to be backported to DRUPAL-5.
(Might be worth it to inspect the other taxonomy_ functions for similar mistakes.)
Comment #6
Wim LeersSorry for the confusion, but my "5.1 patch" is actually a DRUPAL-5 patch :) So it's there already, in #4.
Comment #7
drummCommitted to 5.
Comment #8
(not verified) CreditAttribution: commented