Curly brackets have been left out at line 137. Critical bug that could wreck multi-site installs.

137c137
< $build_q = 'INSERT INTO {similarnodes} (nid,tid,weight) SELECT n.nid, tn.tid, "%d" as weight FROM node n , term_node tn , term_data dt WHERE n.nid = tn.nid AND tn.tid = dt.tid AND dt.vid = %d';
---
> $build_q = 'INSERT INTO {similarnodes} (nid,tid,weight) SELECT n.nid, tn.tid, "%d" as weight FROM {node} n , {term_node} tn , {term_data} dt WHERE n.nid = tn.nid AND tn.tid = dt.tid AND dt.vid = %d';

Comments

greggles’s picture

Title: Missing curlies around table names » Missing curlies around table names and query style (inner joins)
Status: Active » Needs review
StatusFileSize
new1.12 KB

Here's a patch to fix this and also to fix the query style. Drupal standard is to use "INNER JOIN" instead of doing joins inside of the WHERE clause.

joachim’s picture

+1

Though the patch is missing curlies on term_data :)