Hi,

It would be nice to have "disapprove" link for comments in Views.
In my project I found it really useful when using Flags (there's a View that shows all flagged comments, and administrator can "approve" or "disapprove" them).

I've created the issue for Drupal core comment.module here:
http://drupal.org/node/1545220

Be sure to apply my patch for comment.module to get it working.

ALSO, i contributed a module to provide this possibility:
http://drupal.org/node/1546758

My best,
Roman

Comments

barbun’s picture

Here goes my patch for comment.module and Views:

Using git, in a drupal root:
git apply -v comment-disapprove-link-1545220-2.patch

git apply -v --directory=PATH_TO_VIEWS_CONTRIB_MODULE views-comment-disapprove-link-1545220-2.patch

Status: Needs review » Needs work

The last submitted patch, comment-disapprove-link-1545220-2.patch, failed testing.

barbun’s picture

Sorry, patch in #1 had wrong module directory. Here's the correct one.

Also, patch for comment.module cannot be automatically applied, because of different for apply.
See my issue for comment.module: http://drupal.org/node/1545220

barbun’s picture

Status: Needs work » Needs review
tim.plunkett’s picture

Status: Needs review » Needs work

The new include file also needs an entry in views.info.

barbun’s picture

Status: Needs work » Needs review
StatusFileSize
new2.57 KB

Thanks, Tim! My bad.
Here's the updated one.

Status: Needs review » Needs work

The last submitted patch, views-comment-disapprove-link-1545326-6.patch, failed testing.

barbun’s picture

Status: Needs work » Needs review
StatusFileSize
new2.53 KB

Status: Needs review » Needs work

The last submitted patch, views-comment-disapprove-link-1545326-7.patch, failed testing.

barbun’s picture

Status: Needs work » Needs review
StatusFileSize
new2.48 KB
dawehner’s picture

Status: Needs review » Needs work
+++ b/modules/comment/views_handler_field_comment_link_disapprove.incundefined
@@ -0,0 +1,30 @@
+    $this->additional_fields['status'] = 'status';

You could actually drop this line and just $comment = $this->get_value($values); below. The entity is loaded anyway.

+++ b/modules/comment/views_handler_field_comment_link_disapprove.incundefined
@@ -0,0 +1,30 @@
+    $this->additional_fields['status'] = 'status';

You could actually drop this line and just $comment = $this->get_value($values); below. The entity is loaded anyway.

The rest though looks RTBC

barbun’s picture

Status: Needs work » Needs review
StatusFileSize
new2.38 KB

Got it, thanks!

Status: Needs review » Needs work

The last submitted patch, views-comment-disapprove-link-1545326-12.patch, failed testing.

barbun’s picture

Status: Needs work » Needs review
StatusFileSize
new2.38 KB

Status: Needs review » Needs work

The last submitted patch, views-comment-disapprove-link-1545326-14.patch, failed testing.

barbun’s picture

Status: Needs work » Needs review
StatusFileSize
new2.38 KB
barbun’s picture

Issue summary: View changes

Added link

dawehner’s picture

Status: Needs review » Fixed

Thanks this looks perfect now! After some really minor changes committed it to 7.x-3.x.

dawehner’s picture

Status: Fixed » Closed (won't fix)

OOOOH actually views will never contain features which aren't supported by core.

I reverted your patch, as it doesn't make sense to add a non-supported feature to views, sorry.

As d7 is feature frozen the patch will never land there, but as you know you can use your module as well.

webchick’s picture

Issue summary: View changes

Added link to a contributed module.