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.
$result = db_query('SELECT t.*, tid1, tid2 FROM {taxonomy_term_relation}, {taxonomy_term_data} t WHERE (t.tid = tid1 OR t.tid = tid2) AND (tid1 = :tid1 OR tid2 = :tid2) AND t.tid != :tid ORDER BY weight, name', array(':tid' => $tid, ':tid1' => $tid, 'tid2' => $tid));
(notice the 'tid2' instead of ':tid2')
Comment | File | Size | Author |
---|---|---|---|
#2 | 451678-taxonomy-get-related-oh-my-this-is-broken.patch | 1.12 KB | Damien Tournoud |
Comments
Comment #1
Damien Tournoud CreditAttribution: Damien Tournoud commentedSee also #451684: How to deal with invalid placeholders?.
Comment #2
Damien Tournoud CreditAttribution: Damien Tournoud commentedFixing that is not difficult, of course.
Comment #3
Dave ReidShould we maybe consider rewriting that query with DBTNG? :/
Comment #4
Damien Tournoud CreditAttribution: Damien Tournoud commentedThis is a static query, no need to convert it for now.
Comment #5
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.