Project:Similar entries
Version:master
Component:Code
Category:task
Priority:normal
Assigned:deekayen
Status:closed (fixed)

Issue Summary

Module raises the following error when used with Drupal 4.7:

"Unknown column 'n.body' in 'field list' query:

SELECT n.nid, n.title , match(n.body, n.title) AGAINST ("...") AS score FROM node n WHERE MATCH(n.body, n.title) AGAINST ("...") AND n.nid <> 389 AND n.status <> 0 ORDER BY score DESC LIMIT 0, 5

in .../drupal/includes/database.mysql.inc on line 108."

Comments

#1

Category:bug report» task
Priority:critical» normal

Poposed solution:

Change last line of README.txt:

ALTER TABLE node_revisions ADD FULLTEXT(title, body);

Change query in similar.module:

$result = db_query_range('SELECT n.nid, n.title , match(r.body, r.title) AGAINST ("%s") AS score FROM {node} n INNER JOIN {node_revisions} r ON n.vid = r.vid WHERE MATCH(r.body, r.title) AGAINST ("%s") AND n.nid <> %d AND n.status <> 0 ORDER BY score DESC', $text, $text, $similar_node_nid, 0, 5);

#2

Status:active» reviewed & tested by the community

Here is the patch.

AttachmentSize
similar_0.patch 1.91 KB

#3

Assigned to:Anonymous» deekayen

#4

Status:reviewed & tested by the community» closed (fixed)

The patch query didn't work, but I modified it and committed to CVS for DRUPAL-4-7.