I would like to add an 'Approve Comment' link to a view, so that admins don't need to visit the node if they know they want to approve a comment (the same way that they could Delete it using the Delete link that is made available).

I see that the /comment/cid/approve url has a ?token= query attached to it -- is there any way for Views to access this value, or is this feature just not possible?

Comments

dawehner’s picture

Sure this would be possible if you use this code snippet for generate the query key of the link

   'query' => array('token' => drupal_get_token("comment/$comment->cid/approve")),
merlinofchaos’s picture

Well, that wouldn't get the permissions, so we need one that has proper field access testing.

merlinofchaos’s picture

A good workaround, though, is probably to use VBO and have approve as an action.

dawehner’s picture

Status: Active » Fixed

Just commited this feature to 7.x-3.x

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

wOOge’s picture

I see this feature was committed — how does one access the "approve" link in views (as I would an "edit" link)?

dawehner’s picture

Well you need the current dev version.

Once you have it, you will have a new "approve link" field available

in views.