summaryrefslogtreecommitdiff
path: root/modules/comment
diff options
context:
space:
mode:
Diffstat (limited to 'modules/comment')
-rw-r--r--modules/comment/comment.install15
-rw-r--r--modules/comment/comment.module6
2 files changed, 3 insertions, 18 deletions
diff --git a/modules/comment/comment.install b/modules/comment/comment.install
index 84111ce1e..1b63d4aa3 100644
--- a/modules/comment/comment.install
+++ b/modules/comment/comment.install
@@ -46,21 +46,6 @@ function comment_enable() {
}
/**
- * Changed node_comment_statistics to use node->changed to avoid future timestamps.
- */
-function comment_update_1() {
- // Change any future last comment timestamps to current time.
- db_query('UPDATE {node_comment_statistics} SET last_comment_timestamp = %d WHERE last_comment_timestamp > %d', REQUEST_TIME, REQUEST_TIME);
-
- // Unstuck node indexing timestamp if needed.
- if (($last = variable_get('node_cron_last', FALSE)) !== FALSE) {
- variable_set('node_cron_last', min(REQUEST_TIME, $last));
- }
-
- return array();
-}
-
-/**
* @defgroup updates-6.x-to-7.x Comment updates from 6.x to 7.x
* @{
*/
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 164ef195b..e02f964f4 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -435,7 +435,7 @@ function comment_new_page_count($num_comments, $new_replies, $node) {
WHERE nid = :nid
AND status = 0
ORDER BY timestamp DESC) AS thread
- ORDER BY SUBSTRING(thread, 1, (LENGTH(thread) - 1))', array(':nid' => $node->nid), 0, $new_replies)->fetchField();
+ ORDER BY SUBSTRING(thread, 1, (LENGTH(thread) - 1))', 0, $new_replies, array(':nid' => $node->nid))->fetchField();
$thread = substr($result, 0, -1);
$count = db_query('SELECT COUNT(*) FROM {comment} WHERE nid = :nid AND status = 0 AND SUBSTRING(thread, 1, (LENGTH(thread) - 1)) < :thread', array(
':nid' => $node->nid,
@@ -2240,10 +2240,10 @@ function _comment_update_node_statistics($nid) {
if ($count > 0) {
// Comments exist.
- $last_reply = db_query_range('SELECT cid, name, timestamp, uid FROM {comment} WHERE nid = :nid AND status = :status ORDER BY cid DESC', array(
+ $last_reply = db_query_range('SELECT cid, name, timestamp, uid FROM {comment} WHERE nid = :nid AND status = :status ORDER BY cid DESC', 0, 1, array(
':nid' => $nid,
':status' => COMMENT_PUBLISHED,
- ), 0, 1)->fetchObject();
+ ))->fetchObject();
db_update('node_comment_statistics')
->fields( array(
'comment_count' => $count,