Hello,

I am having an issue with blog comments. I give permissions to anonymous users to access and post comments. Anonymous users then fill out the comments form and the page refreshes after hitting submit but nothing shows up in the comments approval queue.

I checked the database and the comments are being added to the comments table. They just aren't showing up in the approval queue or on the blog node.

I also tried setting the permissions so that users didn't need approval. Same thing happens. Whats interesting is that the number of comments that I have displayed in the footer of the blog teaser says that there are comments. But they are not shown.

This thread has a discussion about it with others having the same issue. http://drupal.org/node/340220

- I thought mollom might be an issue but it did not matter.
- Cron runs daily
- permissions are correct
- admin can post comments with no issues

Comments

jgordon’s picture

It looks like the issue is the use of an inner join on the users table instead of a left join when finding comments. If the comment is posted by an anon user, who doesn't have an entry in the user's table then the comment will be filtered out by the inner join. A left join will include records in the left table (comment) that may not exist in the right table (users).

chadcross’s picture

Category: support » bug
damien tournoud’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

Please verify that your database is not corrupt.

You should have an entry in the "users" table with uid = 0.

jgordon’s picture

The database isn't corrupt, but it was missing the uid=0 record. I'm not sure why, it could have been deleted accidentally by someone at some point.

The reason I believe this is a bug is that the join(s) could potentially lose records at some point if a user id doesn't exist in the users table but does in the comments table. To say the situation isn't possible I think we be to ignore a potential problem.

Now, I could be totally wrong here and using a left as opposed to an inner join could cause side effects I haven't experienced or thought about.

chadcross’s picture

jgordon works with me and on the site I originally posted about. Sorry if there was any confusion.

ainigma32’s picture

Status: Postponed (maintainer needs more info) » Fixed

Good to hear the problem was resolved.

- Arie

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Konstantin_by’s picture

I have same problem on my new 6.10 drupal site. What can I do?

Konstantin_by’s picture

I just go to database table "users" in first column change uid=16 to uid=0.

hansamurai’s picture

What happened to me when I moved hosts (transferred database), the anon uid 0 got changed to the highest uid used + 1. Not sure why, but simply changing it back to zero works perfectly.

vivand’s picture

Adding a uid=0 record to the user table did the trick!