Closed (fixed)
Project:
Drupal core
Component:
comment.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Oct 2004 at 21:59 UTC
Updated:
25 Apr 2006 at 19:48 UTC
In the node table, status 0 means unpublished; status 1 means published.
In the comments table, status 0 means published; status 1 means unpublished.
Shouldn't we be consistent?
Comments
Comment #1
ax commenteddefinitely. consistent - and readable. for the sake of readability, we should really use constants for any similar ... constants.
ie.
node.module:
define('NODE_STATUS_NOT_PUBLISHED', 0);
define('NODE_STATUS_PUBLISHED', 1);
comment.module:
define('COMMENT_STATUS_NOT_PUBLISHED', 0);
define('COMMENT_STATUS_PUBLISHED', 1);
define('COMMENT_STATUS_DELETED', 2);
(see 'Status' field values for nodes and comments)
and you would never need to break your head about what that 1 was again ...
any volunteer? :)
Comment #2
Uwe Hermann commentedWhile I think having these constants is a good idea, that still leaves the problem of confusion when you hand-edit your database tables. In the database you still only read 0, 1 and 2 and not any readable names...
Another problem is the upgrading of Drupal installations, which needs to be done properly, or else many sites will have wrong values in their database...
Comment #3
sofiya commentedim following this up. for consitency, can these two lines in comment.module:
be inter/changed to:
and in the upgrade script:
Comment #4
jvandyk commentedThe following noncore modules (in addition to core) would need to be changed as they use the status field of the comment table:
authorise/patches/tree.patch
commentrss/commentrss.module
devel/generate/generate-content.php
notify/notify.inc
quote/quote.module
spam/optional/comment.module.patch
spam/spam.module
trip_search/trip_search.module
workspace/workspace.module
Comment #5
Zen commentedThese changes have gone through :)
-K