Download & Extend

sql syntax errors with taxonomy_dhtml

Project:Taxonomy
Version:4.0.0
Component:Modules
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Running off of Drupal CVS (tonight's build was installed one hour ago). Am using the 1.18 version of taxonomy_dhtml from CVS and assuming that it runs with CVS (could be that it does not).

Here are some of the errors:

warning: Invalid argument supplied for foreach() in /home/cel4145/public_html/modules/taxonomy_dhtml.module on line 105.

user error: You have an error in your SQL syntax near 'SELECT n.nid, n.title, u.uid, u.name FROM term_node r LEFT JOIN node n ON r.nid ' at line 1
query: SELECT n.nid, n.title, u.uid, u.name FROM term_node r LEFT JOIN node n ON r.nid = n.nid LEFT JOIN users u ON n.uid = u.uid WHERE n.status = '1' AND r.tid = '11' ORDER BY n.changed DESC LIMIT SELECT n.nid, n.title, u.uid, u.name FROM term_node r LEFT JOIN node n ON r.nid = n.nid LEFT JOIN users u ON n.uid = u.uid WHERE n.status = '1' AND r.tid = '11' ORDER BY n.changed DESC, 50 in /home/cel4145/public_html/includes/database.mysql.inc on line 75.

You can view the errors at http://cyberdash.com/?q=taxonomy_dhtml

Comments

#1

Sorry. The link above is no longer available. Have switched back to 4.1.

#2

Looks like the syntax is wrong for the db_query_range calls. Here is a patch to fix it. Not sure if this is the right place for the patch.

--- taxonomy_dhtml.module 2003-04-23 14:57:24.000000000 -0400
+++ /usr/local/share/cago/www/modules/taxonomy_dhtml.module 2003-05-06 01:35:12.000000000 -0400
@@ -128,7 +128,7 @@
for ($i=0; $i name;

- $result = db_query_range("SELECT tid, name FROM term_data WHERE vid = '". $vocabularies[$i]->vid. "'", 3);
+ $result = db_query_range("SELECT tid, name FROM term_data WHERE vid = '". $vocabularies[$i]->vid. "'", 0, 3);
while ($term = db_fetch_object($result)) {
$tids[] = $term->tid;
$names[] = $term->name;
@@ -150,7 +150,7 @@
// iterate over the tree backwards, so I don't trip on the new items
for ($i=count($tree)-1; $i>=0 ; $i--) {
$term = $tree[$i];
- $result = db_query_range("SELECT n.nid, n.title, u.uid, u.name FROM term_node r LEFT JOIN node n ON r.nid = n.nid LEFT JOIN users u ON n.uid = u.uid WHERE n.status = '1' AND r.tid = '$term->tid' ORDER BY n.changed DESC", 50);
+ $result = db_query_range("SELECT n.nid, n.title, u.uid, u.name FROM term_node r LEFT JOIN node n ON r.nid = n.nid LEFT JOIN users u ON n.uid = u.uid WHERE n.status = '1' AND r.tid = '$term->tid' ORDER BY n.changed DESC", 0, 50);
while ($node = db_fetch_object($result)) {
$detail = t("Author: %name, comments: %num", array ("%name" => strip_tags(format_name($node)), "%num" => comment_num_all($node->nid)));
$link = l($node->title, "node/view/$node->nid", array ("title" => $detail, "class" => "dhtml_node"));
@@ -235,4 +235,4 @@
return $output;
}

-?>
\ No newline at end of file
+?>

#3

Pstatus: Closed

i just comitted a fix. closing.

#4

Closing (via Web - close by mail possibly busted).