We're using Recent Blocks to simply display a plain list of the most recent comments without posting time.

The module is displaying unpublished comment node titles in the list. We haven't tested this for other kinds of nodes, but if we unpublish a comment, the title still shows up in the list (this also happens with comments which have been marked as spam and unpublished by the spam module).

These unpublished comments can't actually be viewed - only the titles are visible in the Recent Blocks list. They are shown to all users - anonymous or authenticated.

Thanks for a very useful module. (I wish there was more like this in standard Drupal - much nicer using this module than having to edit the php and views etc to make a custom block!)

Comments

kaosae’s picture

Title: Displays unpublished comment node titles » My Fix
Status: Active » Needs review

This fixed it for me. In the file recent_blocks.module,

replace this:

"WHERE $common_where AND c.cid IS NOT NULL". // c.cid is null iff the node has no comment

with this:

"WHERE $common_where AND c.cid IS NOT NULL AND c.status = 0". // c.cid is null iff the node has no comment

bsimon’s picture

Yes your fix works for us. Don't see any problems,

Thanks!

cotto’s picture

Status: Needs review » Fixed

Thanks for catching this. I've confirmed the misbehavoir and applied the patch. I have a few other changes to make, but this will be posted by the end of the day.

Anonymous’s picture

Status: Fixed » Closed (fixed)