Download & Extend

Titles of unpublished nodes (which have comments) appear on the live discussions block

Project:Live Discussion
Version:4.7.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Prometheus6
Status:closed (fixed)

Issue Summary

How do you tweak the code to correct this?

Thanks in advance!

Comments

#1

Okay, this solution worked. Looked at the comments.module and saw that function theme_comment_block() had a "WHERE n.status = 1" condition and I added this too to the live_discussions module. In line 83 just change

// create the SQL
      $query = "SELECT c.nid, n.title, COUNT(c.nid) AS comment_count, MAX(c.timestamp) AS the_time FROM {comments} c ".
               "LEFT JOIN {node} n ON n.nid = c.nid WHERE c.status = 0 ".$select_blog." GROUP BY c.nid ORDER BY the_time DESC ".
               "LIMIT ".$commented_limit;

to

// create the SQL
      $query = "SELECT c.nid, n.title, COUNT(c.nid) AS comment_count, MAX(c.timestamp) AS the_time FROM {comments} c ".
               "LEFT JOIN {node} n ON n.nid = c.nid WHERE n.status = 1 AND c.status = 0 ".$select_blog." GROUP BY c.nid ORDER BY the_time DESC ".
               "LIMIT ".$commented_limit;

#2

Assigned to:Anonymous» Prometheus6
Status:active» fixed

Good catch. Thanks.

#3

Status:fixed» closed (fixed)
nobody click here