[drupal-devel] [bug] comment block shows comments from unpublished nodes

Uwe Hermann drupal-devel at drupal.org
Sun Aug 28 17:45:09 UTC 2005


Issue status update for 
http://drupal.org/node/29866
Post a follow up: 
http://drupal.org/project/comments/add/29866

 Project:      Drupal
 Version:      4.6.2
 Component:    comment.module
 Category:     bug reports
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  Florian Hufsky
 Updated by:   Uwe Hermann
-Status:       active
+Status:       patch (code needs review)
 Attachment:   http://drupal.org/files/issues/comment_14.patch (1.07 KB)

Confirmed in HEAD. Patch attached. Should probably be backported to 4-6,
too.




Uwe Hermann



Previous comments:
------------------------------------------------------------------------

Sun, 28 Aug 2005 16:58:10 +0000 : Florian Hufsky

The comment block shows links comments which were once published, but
later set to "don't publish".


How to reproduce the bug:


1. create a node
2. post a comment
3. edit the node: set uncheck published


Bugfix:


change the sql query for comments to show in comment_block:


modules/comment.module
Line 184


to


SELECT c.nid, c.* FROM {comments} c INNER JOIN {node} n USING (nid)
WHERE n.status = 1 AND c.status = 0 ORDER BY c.timestamp DESC







More information about the drupal-devel mailing list