Titles of unpublished nodes (which have comments) appear on the live discussions block
noid - September 23, 2006 - 19:24
| Project: | Live Discussion |
| Version: | 4.7.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Prometheus6 |
| Status: | closed |
Jump to:
Description
How do you tweak the code to correct this?
Thanks in advance!

#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
Good catch. Thanks.
#3