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.
In token_node, a query has been changed to user db_query_range instead of LIMIT 0,1. The rewrite broke the query logic, resulting in query errors:
user warning: Unknown column 'r.vid' in 'where clause' query: SELECT t.tid, t.name FROM term_data t INNER JOIN term_node r ON r.tid = t.tid WHERE t.vid = 16 AND r.vid = 44780 ORDER BY weight LIMIT 0, 1 in /var/www/html/includes/database.mysql.inc on line 174.
The attached patche fixes this.
Comment | File | Size | Author |
---|---|---|---|
#10 | 485346.patch | 1.52 KB | fgm |
token_node.inc_.patch | 849 bytes | abautu | |
Comments
Comment #1
jadwigo CreditAttribution: jadwigo commentedtested the fix .. works as advertised,
haven't tested the patch itself
Also related to http://drupal.org/node/485210
Comment #2
selfuntitled CreditAttribution: selfuntitled commentedAlso tested the fix, no problems so far.
Comment #3
kingandy CreditAttribution: kingandy commentedFix looks good to me.
I'm guessing this is the result of backporting a change from Drupal 6, where the term_node table does include the VID for revisions...
Comment #4
gregglesThanks all for the patch and reviews. This is now fixed http://drupal.org/cvs?commit=223518
I'll make a new release soon.
Comment #5
kardave CreditAttribution: kardave commentedHi,
I was too carefull, so i tried out some modules that use token. If not, I would break my production site. Thank God I have test site for this :)
Pathauto doesn't work correctly with Token 5.x-1.12 (token [vocab-raw] and [vocab] is empty at nodes)
You should aware users from using this version.
Comment #6
gregglesWe could warn users about this or we could just make a new release :)
Anyone else know of other critical bugs in token?
Comment #7
kardave CreditAttribution: kardave commentedI vote for new release. :)
Comment #8
greggleshttp://drupal.org/node/488728 - will be published in ~5 minutes
Comment #10
fgmProblem has apparently been reintroduced in 5.1.14:
user warning: Unknown column 'r.vid' in 'where clause' query: SELECT t.tid, t.name FROM term_data t INNER JOIN term_node r ON r.tid = t.tid WHERE t.vid = 1 AND r.vid = 15733 ORDER BY t.weight LIMIT 0, 1 in /var/www/drupal-5.22/includes/database.mysql.inc on line 174.
the query appears in token_node.inc#node_token_values(), line 98:
should likely be:
Comment #11
Dave ReidIt's been fixed already in 5.x-1.x-dev.
Comment #12
Dave Reid