Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
comment.module
Priority:
Critical
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
23 Aug 2010 at 18:59 UTC
Updated:
4 Nov 2010 at 06:20 UTC
Jump to comment: Most recent file
Comments
Comment #1
scor commentedattaching a Drupal 6.19 db dump containing a few comments and "access comments" for anonymous user, which you can use to reproduce this bug (login as uid 1 with admin/admin).
Comment #2
aspilicious commentedThere is a patch changing the names of the permissions in drupal 7 cause they are confusing.
This is not a critical bug (if I find the issue)
EDIT: I was wrong, issue was about posting comments.
Comment #3
scor commentedlooking into this.
Comment #4
scor commentedThe bug was in comment_update_7001() which sets comment.status of all records to 3. The k/v pairs of $changes need to be swapped.
Comment #5
jody lynnI see that comment status codes were swapped between 0 and 1 for unpublished, but I don't understand what a comment status of 3 represents.
Comment #6
sunWeird. Also no idea what 3 could be. I only know of switched COMMENT_PUBLISHED and COMMENT_NOT_PUBLISHED constants, and therefore $comment->status (column values).
So 0 <=> 1 would be sufficient.
Comment #7
jody lynnFound the back story in CVS.
In #237636: Comment status field should match node status field the 3 was introduced, presumably to avoid a race condition during the update. Then in #570900: Destroy remnants of update_sql() Crell refactored the update and the keys ended up reversed.
So I think scor's patch is exactly right, except I'm not sure if we still are at risk of race conditions here. If not, we should remove the use of '3', as we never know if someone has a custom module that uses a status of 3 for their own purpose, so not doing that would be preferable.
Comment #8
scor commentedUsing anything different from 0 and 1 as status means you lose the core comment functionality (core will not know what to do with such status value and will ignore these comments). Anyways, I've changed the patch to account for that by ensuring we choose a temporary status which is different from the existing status values.
Comment #9
bjaspan commentedWith this plus #890210: Cannot enable Comment module after a Drupal 6 to Drupal 7 upgrade, I can upgrade the test database from D6 to D7, enable the comment module, and see the comments in all the right places. RTBC.
I can't mark the other issue RTBC since it is my patch but hopefully it will go in soon. :-)
Comment #10
bjaspan commentedBy RTBC, I meant "RTBC". :-)
Comment #11
webchickCommitted to HEAD! Thanks!