Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
comment.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
30 Dec 2008 at 02:19 UTC
Updated:
2 Jan 2014 at 23:45 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
moshe weitzman commentedGood catch catch.
Comment #2
dries commentedI committed this to CVS HEAD. I believe it should go into DRUPAL-6 but I'll leave that up to Gabor so he can review it once more. Updated the version accordingly. It might need a re-roll for Drupal 6 ...
Comment #3
catchThanks. Re-roll for 6.
Comment #4
catchThis broke comment approval tests - if a node only has one comment, and that comment is unpublished, we no longer render it. We could probably find a way around this like a separate 'has comments' flag to the count one, but for now here's a straight revert. I miss the test bot :(
Comment #5
dries commentedRolled back the patch.
Comment #6
catchThanks Dries.
This gets more interesting.
I fixed the first bug with a user_access('administer comments') check.
However, I then found that the comment 'approve' link bypasses comment_save (as does everything in http://api.drupal.org/api/function/comment_operations/6) - this means that node_comment_statistics never gets updated - so the tests still have one fail without that being fixed.
Also, when manually testing the comment approval, I noticed that the published/unpublished radios are mislabeled. Fun.
So, here's a new patch which both adds the proper checks to avoid the query, and fixes comment_approve() so that tests continue to pass, this bug was hidden due to the lack of the $node->comment_status check but is now covered by the comment approval test.
I've opened issues for the other two bugs at #352911: comment administration form mis-labeling and #352895: comment_operations bypasses comment_save.
comment_save() should also take a properly formatted comment object instead of a fapi array, but there must be an issue for that somewhere already.
Comment #7
catchBetter code comment.
Comment #8
moshe weitzman commentedWelcome to dark dark world of comment module.
Comment #10
catchComment #11
catchComment #12
moshe weitzman commentedthanks, comment module maintainer :)
Comment #14
catchre-rolled due to a whitespace change. No changes, so leaving RTBC.
Comment #15
webchickCommitted to HEAD, thanks! :)