selects nodes from queue
baybara - September 8, 2005 - 07:24
| Project: | Similar Entries |
| Version: | HEAD |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | deekayen |
| Status: | closed |
Description
it selects similar entries even they are in the submission queue...

#1
Try editing the SQL query at line 88 from the similar.module
And add: "AND n.status <> 0" to the Query.
It will look like this:
$result = db_query_range('SELECT n.nid, n.title , match(n.body, n.title) AGAINST ("%s") AS score FROM {node} n WHERE MATCH(n.body, n.title) AGAINST ("%s") AND n.nid <> %d AND n.status <> 0 ORDER BY score DESC', $text, $text, $similar_node_nid, 0, 5);
I think you can also use: "AND n.status = 1"
Regards
#2
I forgot to user the code mode:
Text to add to de query:
AND n.status <> 0New query:
$result = db_query_range('SELECT n.nid, n.title , match(n.body, n.title) AGAINST ("%s") AS score FROM {node} n WHERE MATCH(n.body, n.title) AGAINST ("%s") AND n.nid <> %d AND n.status <> 0 ORDER BY score DESC', $text, $text, $similar_node_nid, 0, 5);#3
Same problem here - hope it will be fixed soon.
#4
Here is the patch that implements Povinho's solution. Please review so it can be committed ASAP.
#5
#6
This affects http://drupal.org/node/41931 so I'll take it on.
#7
Added
AND n.status <> 0so the query only selects published nodes. Committed to CVS for DRUPAL-4-7.#8