summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2004-11-18 21:16:30 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2004-11-18 21:16:30 +0000
commit90e67a3acb226d7d0f45ecd117c1fcfcbe4f0b24 (patch)
tree89fa016a8f3ccb931712cd952adf5971e5bc15e3 /modules
parent41bd0e12344730b0b346fddb42d6c6308da66d4a (diff)
downloadbrdo-90e67a3acb226d7d0f45ecd117c1fcfcbe4f0b24.tar.gz
brdo-90e67a3acb226d7d0f45ecd117c1fcfcbe4f0b24.tar.bz2
Search indexing bug: last updated timestamp needs to take last comment timestamp into account.
Diffstat (limited to 'modules')
-rw-r--r--modules/node.module5
-rw-r--r--modules/node/node.module5
2 files changed, 6 insertions, 4 deletions
diff --git a/modules/node.module b/modules/node.module
index 30fc7c4ab..672b3bdb1 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -1546,16 +1546,17 @@ function node_update_index() {
$last = variable_get('node_cron_last', 0);
$limit = (int)variable_get('search_cron_limit', 100);
- $result = db_query_range('SELECT n.nid FROM {node} n LEFT JOIN {node_comment_statistics} c ON n.nid = c.nid WHERE n.status = 1 AND n.moderate = 0 AND (n.created > %d OR n.changed > %d OR c.last_comment_timestamp > %d) ORDER BY GREATEST(n.created, n.changed, c.last_comment_timestamp) ASC', $last, $last, $last, 0, $limit);
+ $result = db_query_range('SELECT n.nid, c.last_comment_timestamp FROM {node} n LEFT JOIN {node_comment_statistics} c ON n.nid = c.nid WHERE n.status = 1 AND n.moderate = 0 AND (n.created > %d OR n.changed > %d OR c.last_comment_timestamp > %d) ORDER BY GREATEST(n.created, n.changed, c.last_comment_timestamp) ASC', $last, $last, $last, 0, $limit);
while ($node = db_fetch_object($result)) {
+ $last_comment = $node->last_comment_timestamp;
$node = node_load(array('nid' => $node->nid));
// We update this variable per node in case cron times out, or if the node
// cannot be indexed (PHP nodes which call drupal_goto, for example).
// In rare cases this can mean a node is only partially indexed, but the
// chances of this happening are very small.
- variable_set('node_cron_last', max($node->changed, $node->created));
+ variable_set('node_cron_last', max($last_comment, max($node->changed, $node->created)));
if (node_hook($node, 'view')) {
node_invoke($node, 'view', false, false);
diff --git a/modules/node/node.module b/modules/node/node.module
index 30fc7c4ab..672b3bdb1 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -1546,16 +1546,17 @@ function node_update_index() {
$last = variable_get('node_cron_last', 0);
$limit = (int)variable_get('search_cron_limit', 100);
- $result = db_query_range('SELECT n.nid FROM {node} n LEFT JOIN {node_comment_statistics} c ON n.nid = c.nid WHERE n.status = 1 AND n.moderate = 0 AND (n.created > %d OR n.changed > %d OR c.last_comment_timestamp > %d) ORDER BY GREATEST(n.created, n.changed, c.last_comment_timestamp) ASC', $last, $last, $last, 0, $limit);
+ $result = db_query_range('SELECT n.nid, c.last_comment_timestamp FROM {node} n LEFT JOIN {node_comment_statistics} c ON n.nid = c.nid WHERE n.status = 1 AND n.moderate = 0 AND (n.created > %d OR n.changed > %d OR c.last_comment_timestamp > %d) ORDER BY GREATEST(n.created, n.changed, c.last_comment_timestamp) ASC', $last, $last, $last, 0, $limit);
while ($node = db_fetch_object($result)) {
+ $last_comment = $node->last_comment_timestamp;
$node = node_load(array('nid' => $node->nid));
// We update this variable per node in case cron times out, or if the node
// cannot be indexed (PHP nodes which call drupal_goto, for example).
// In rare cases this can mean a node is only partially indexed, but the
// chances of this happening are very small.
- variable_set('node_cron_last', max($node->changed, $node->created));
+ variable_set('node_cron_last', max($last_comment, max($node->changed, $node->created)));
if (node_hook($node, 'view')) {
node_invoke($node, 'view', false, false);