summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGábor Hojtsy2012-02-01 14:43:44 (GMT)
committer Gábor Hojtsy2012-02-01 14:43:44 (GMT)
commit100f9332f1b3c37d91a388ae4cf080482dbaea2b (patch)
treec13b8a43ae3fb9f58ccf94428b0c50125bfe03a3
parent305bcc7d8d34e8716c5d5e481dd9b29e4542676f (diff)
Issue #879270 by Ben Coleman: query in taxonomy_node_get_terms() needs the v.weight field added to the SELECT because it was already present in the ORDER BY; improved PostgreSQL compatibility
-rw-r--r--modules/taxonomy/taxonomy.module2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index fb55d33..168e289 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -637,7 +637,7 @@ function taxonomy_node_get_terms($node, $key = 'tid', $reset = FALSE) {
}
if (!isset($terms[$node->vid][$key])) {
- $result = db_query(db_rewrite_sql('SELECT t.* FROM {term_node} r INNER JOIN {term_data} t ON r.tid = t.tid INNER JOIN {vocabulary} v ON t.vid = v.vid WHERE r.vid = %d ORDER BY v.weight, t.weight, t.name', 't', 'tid'), $node->vid);
+ $result = db_query(db_rewrite_sql('SELECT t.*,v.weight AS v_weight_unused FROM {term_node} r INNER JOIN {term_data} t ON r.tid = t.tid INNER JOIN {vocabulary} v ON t.vid = v.vid WHERE r.vid = %d ORDER BY v.weight, t.weight, t.name', 't', 'tid'), $node->vid);
$terms[$node->vid][$key] = array();
while ($term = db_fetch_object($result)) {
$terms[$node->vid][$key][$term->$key] = $term;