On a system with comment approval activated, the submission of the first comment will redirect the user to an "Access denied" page, because the talk page doesn't exist yet, because the comment is waiting for approval.

Instead of showing "Access denied" page if there isn't any comment, is it possible to display a page with a small text like : "no comment yet"

thanks.

CommentFileSizeAuthor
#4 fix_access_denied_talk09082009.patch550 bytesEqu

Comments

greggles’s picture

Title: Access denied after first comment submission » Access denied after first comment submission if comment moderation is enabled
Equ’s picture

The same behavior if you go to talk page of a node with no comments and with comments approval activated.

brisath’s picture

Great module idea. I'm having the same problem though, an "access denied" messages when a first comment is clicked. I don't have moderation enabled though.

Also, even though I have changed the link to "discussion," when no comments are present it says "add new comment." If a comment is already in place, as with older posts, everything seems to be working fine.

I would really like to use this module. Thanks.

Equ’s picture

Status: Needs review » Active
StatusFileSize
new550 bytes

Ok, I think I've found the problem. It was on line 49:

function _talk_access($node) {
  return ($node->nid && _talk_node_comment_value($node) && talk_activated($node->type) && user_access('access comments') && node_access('view', $node) && $node->comment_count);
}

Removing $node->comment_count worked for me.

The patch is attached.

P.S. It's my first patch, so be careful.

Equ’s picture

Status: Active » Needs review
greggles’s picture

Status: Active » Closed (duplicate)

We fixed this in almost the same way on #530292: if there are no comments show the talk page with some "add a comment" text.

Can you test that and confirm that it works?

I will soon make a new official release of the module which will include this fix.