Blocks won't show if prefixes are used in database table names
| Project: | Related terms |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Thank you for the module.
My Drupal 5 installation uses prefixes in database table names. So query
$sql = "SELECT tn2.tid, td2.name, COUNT(tn.nid) AS cnt FROM term_node tn INNER JOIN term_node tn2 ON tn2.nid = tn.nid INNER JOIN term_data td ON td.tid = tn.tid INNER JOIN term_data td2 ON td2.tid = tn2.tid WHERE (tn.tid = %d) AND tn2.tid <> %d ".$restrict_vids." GROUP BY tn.tid, tn2.tid ORDER BY cnt DESC";
doesn't work. Table names should be wrapped in { }.
$sql = "SELECT tn2.tid, td2.name, COUNT(tn.nid) AS cnt FROM {term_node} tn INNER JOIN {term_node} tn2 ON tn2.nid = tn.nid INNER JOIN {term_data} td ON td.tid = tn.tid INNER JOIN {term_data} td2 ON td2.tid = tn2.tid WHERE (tn.tid = %d) AND tn2.tid <> %d ".$restrict_vids." GROUP BY tn.tid, tn2.tid ORDER BY cnt DESC";
This solves the issue.

#1
+100 D5 & D6
#2
Fixed in 5 and 6.
#3
Automatically closed -- issue fixed for 2 weeks with no activity.