[drupal-devel] [feature] Comment approval queue a pain to use

Uwe Hermann drupal-devel at drupal.org
Sun Sep 18 23:41:15 UTC 2005


Issue status update for 
http://drupal.org/node/28595
Post a follow up: 
http://drupal.org/project/comments/add/28595

 Project:      Drupal
 Version:      cvs
 Component:    comment.module
 Category:     feature requests
 Priority:     normal
 Assigned to:  mrowe
 Reported by:  robertDouglass
 Updated by:   Uwe Hermann
 Status:       patch (code needs review)
 Attachment:   http://drupal.org/files/issues/comment_bulk_approval_2.patch (2.45 KB)

Rerolled patch and fixed a few issues: Using ' instead of " now where
possible, made "Save changes" translatable, use %d more often, indent
code using 2 spaces (not 4). The functionality works as expected and is
quite an improvement over the current stuff.


+1 from me.




Uwe Hermann



Previous comments:
------------------------------------------------------------------------

Wed, 10 Aug 2005 08:29:14 +0000 : robertDouglass

When using the comment approval queue the workflow for approving
comments is awful. You have to click administer->comments->approval
queue to get a list of comments awaiting approval. Then you have to
click edit on one of the comments, click the collabsible field-set for
the publishing controls, click to published and save the comment. Then
repeat the process for the next comment. 


I'd say that this workflow is a significant deterrent to anyone using
this functionality.


To make it better, there would be checkboxes next to each comment in
the table on the approval queue page, and a set of operators analogous
to the content overview page. Better yet would be if each comment in
the table was an AJAX link to the comment's body and info which would
expand right there in the table itself, since it is usually impossible
just from the comment title to know whether to publish or not. If one
could click the various comments open, right there in the table, then
mass publish or delete, we'd have a real approval queue. Perhaps the
spam module could tie into the actions that can be taken on comments so
a mass "mark as spam" could be done too.




------------------------------------------------------------------------

Wed, 14 Sep 2005 13:32:47 +0000 : mrowe

Attachment: http://drupal.org/files/issues/comment_bulk_approval.patch (2.24 KB)

Here's a patch (against HEAD) that gives you the cheap-and-dirty
approach (checkboxes that allow bulk approval/unapproval of comments).


I'll leave the gold-plated AJAX solution to someone with more time. :)




------------------------------------------------------------------------

Wed, 14 Sep 2005 21:17:21 +0000 : Dries

- Don't use tabs.
- SQL queries might be vularnable to SQL injection attacks.  Use
db_query()'s %s and %d directives.




------------------------------------------------------------------------

Thu, 15 Sep 2005 02:24:17 +0000 : mrowe

Attachment: http://drupal.org/files/issues/comment_bulk_approval_0.patch (2.38 KB)

Ok, I think I got rid of all the tabs this time...


I've had to use db_escape_string, rather than the sprintf params to
db_query, but it should have the same effect.




------------------------------------------------------------------------

Thu, 15 Sep 2005 03:28:50 +0000 : moshe weitzman

minor nits: 


we use an extra line in our else clauses. this should be two lines:
 } else {


also, you can almost always avoid using db_escape_string() directly.
you will need to do a str_repeat('%d, ', count($unpublish)) in the
SQL(for unpublish query) and then pass a an array as the last argument
to db_query. This is the seldom used 'pass all values in an array'
feature of db_query: http://drupaldocs.org/api/head/function/db_query




------------------------------------------------------------------------

Thu, 15 Sep 2005 11:10:20 +0000 : mrowe

Attachment: http://drupal.org/files/issues/comment_bulk_approval_1.patch (2.43 KB)

Oh, so you're saying I should have read the style guide... ;)


I've fixed the brace position, and I've redone the db_query as you
suggested.


Thanks!




------------------------------------------------------------------------

Sun, 18 Sep 2005 11:36:02 +0000 : Dries

Code needs more small style fixes.  Haven't tried the patch, nor did I
try to look at the big picture.  However, I agree that the comment
approval workflow sucks.  How do other systems deal with this?  What
does their UI and interaction design look like?







More information about the drupal-devel mailing list