Update similar.module to Drupal 4.7

naudefj - December 21, 2005 - 05:40
Project:Similar Entries
Version:HEAD
Component:Code
Category:task
Priority:normal
Assigned:deekayen
Status:closed
Description

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."

#1

naudefj - December 21, 2005 - 06:41
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

naudefj - December 27, 2005 - 19:08
Status:active» reviewed & tested by the community

Here is the patch.

AttachmentSize
similar_0.patch 1.91 KB

#3

deekayen - January 2, 2006 - 04:53
Assigned to:Anonymous» deekayen

#4

deekayen - January 4, 2006 - 02:10
Status:reviewed & tested by the community» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.