This little patch creates 2 actions. These are basically a copy of the submit function in the comment moderation form in an actions format. This is very useful for Views Bulk Operations compatibility and in use in a comment moderation view.

  • mollom_unpublish_comment
  • mollom_delete_comment

Cheers,
Neil

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Reid’s picture

Also see #152603: Revise comment admin interface like content admin, add hook_comment_operations() since the Mollom module technically already provides these actions, but has to hack them into the current comment listing interface.

sun’s picture

Status: Needs review » Needs work

Taking into account #717212: Remove "report to Mollom" links and integrate with entity delete confirmation forms instead, we should only provide actions to report a post.

Although I'm not sure how useful such an action is.

sun’s picture

Status: Needs work » Closed (duplicate)

Thanks for taking the time to report this issue.

However, marking as duplicate of #245689: Integrate actions with reporting functionality on delete confirmation forms.
You can follow up on that issue to track its status instead. If any information from this issue is missing in the other issue, please make sure you provide it over there.

moshe weitzman’s picture

Status: Closed (duplicate) » Needs work

I don't agree with marking this as a dupe. This is a small, useful feature that can be used in Views Bulk Operations and elsewhere. Making it dependant on a confirm form issue is needlessly blocking it. It has already blocked for months. If the admins disagree, feel free to set this back to dupe.

Instead of a drupal_set_message(), a watchdog() would be more consistent with core. See the action below from core. The drupal_set_message calls would look upgly after deleting a hundred spams using views bulk operations.

I'll make the above change if the committers think this patch can proceed.

greggles’s picture

subscribing.

I agree this is a great idea to add. I agree holding it back based on a relatively unrelated issue is unfortunate.

Ultimately this means that mollom.com will get less information about spam comments. I'm building a view to delete a few hundred spam comments on g.d.o and now instead of reporting them to mollom I will simply delete them. That is valuable information that mollom.com loses out on.

Mark Nielsen’s picture

Is there anything that can be done to hurry this along to a conclusion? I could test the patch if that helps (although - 2009? - is this going to work with the current dev release?).

I'm not sure how much longer I can use Mollom if I can't integrate it into Views Bulk Actions and Rules. Viewing individual comments and reporting them is just too time-consuming, so, like greggles, I often find my only option is to delete them and deny mollom.com the spam information.

anavarre’s picture

Subscribe

gordon’s picture

subscribe

1kenthomas’s picture

Priority: Normal » Major

I'm going to bump the priority here. Otherwise, what can I do to help :) ?

deverman’s picture

I was so surprised to find that mollom doesn't support a link in views to mark as spam or a views bulk operation!

ezra-g’s picture

gordon’s picture

Updated patch for the latest version of Mollom

gordon’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 0001-Issue-655846-by-indytechcook-gordon-Added-Mollom-Act.patch, failed testing.

gordon’s picture

Status: Needs work » Needs review
FileSize
2.81 KB

Fix up issue in mollom_action_info().

gordon’s picture

FileSize
12.51 KB

Here is a view which I use with great success to remove spam quickly from a site.

gordon’s picture

Found a small bug when going to 2.x

gordon’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev

Fix up version

AlfTheCat’s picture

greggles’s picture

I did a quick query to find the most followed, open issues for mollom module:

Count | Nid | Title
       45 | http://drupal.org/node/353588            | Your submission has triggered the installed spam filter and will not be accepted.
|       23 | http://drupal.org/node/869782            | Appeal!: Explain what a user should do if "Your submission has triggered the spam filter and will not be accepted."
|       17 | http://drupal.org/node/245364            | Provide API to programmatically validate content (integration with Trackback module)
|       17 | http://drupal.org/node/655846            | Mollom Actions
|       17 | http://drupal.org/node/364575            | Support alternative spam rejection methods than a CAPTCHA (e.g. unpublishing)
|       16 | http://drupal.org/node/921772            | Report to Mollom 'registered spam users accounts' and delete account                                                             | 

So, the first two are basically just people who need support and are confused by the module. The next 3 are tied for most important meaning that this issue is tied for the most followed open issue in the mollom queue.

Further - #655846: Mollom Actions and #921772: Report to Mollom 'registered spam users accounts' and delete account are pretty similar since 921772 is just chaining together two actions (if the code were organized as actions). So, 2 out of the top 4 issues are pretty related.

It's interesting to note that this issue has 12 commenters but 17 followers.

rooby’s picture

Status: Needs review » Needs work

Here is a bit of patch review - Damn, just realised the patch was for drupal 6, which explains the bugs I had.

So just nit-picky stuff here now.

+++ b/mollom.module
@@ -3381,3 +3381,81 @@ function profile_mollom_form_info_alter(&$form_info, $form_id) {
+  return array(
+    // Unpublish Action
+    'mollom_unpublish_comment' => array(
+      'description' => t('Report to Mollom as spam and unpublish'),
+      'type' => 'comment',
+      'configurable' => FALSE,
+      'hooks' => array(
+        'comment' => array('insert', 'update'),
+      ),
+    ),
+    // Delete action
+    'mollom_delete_comment' => array(
+      'description' => t('Report to Mollom as spam and delete'),
+      'type' => 'comment',
+      'configurable' => FALSE,
+      'hooks' => array(
+        'comment' => array('insert', 'update'),
+      ),
+    ),
+  );

Comments should have full stops.

+++ b/mollom.module
@@ -3381,3 +3381,81 @@ function profile_mollom_form_info_alter(&$form_info, $form_id) {
+ * Preform action and send to Mollom as Spam

I assume Preform should be Perform, and it needs a full stop.

+++ b/mollom.module
@@ -3381,3 +3381,81 @@ function profile_mollom_form_info_alter(&$form_info, $form_id) {
+  // First, send the proper information to the XML-RPC server:
...
+  // Second, perform the proper operation on the comments:

These comments should probably have full stops instead of colons.

+++ b/mollom.module
@@ -3381,3 +3381,81 @@ function profile_mollom_form_info_alter(&$form_info, $form_id) {
+ */
\ No newline at end of file
-- 
1.7.5.4

Should not remove the newline at the end of the file.

Plus we now need a D7 version.

ttkaminski’s picture

Version: 6.x-2.x-dev » 7.x-2.5
Status: Needs work » Needs review
FileSize
2.17 KB

Updated the patch to work with D7. Made some changes:

1. Enabled aggregate mode on the actions. This takes advantage of the *_multiple() functions, thus making the operation more optimal.
2. Removed the drupal_set_message(). Not needed as VBO already provides information about the results of the operation.

gordon’s picture

Priority: Major » Critical

Bump!

In light of the recent Spamming of Groups, and they Groups users VBO and actions to allow deleting of a users content. Right NOW it is only deleting the content and not notifying mollom that this is being deleted because of SPAM. This is not helping Mollom get rid of our spam. Adding this will help Mollom combat out current spam issue.

Mark Nielsen’s picture

Priority: Critical » Major

Feature requests shouldn't be marked Critical, according to the policy on Priority levels of issues. So I hope it's OK for me to drop it back to Major.

I doubt that upping the Priority would speed anything up anyway. Though I wish there was something that would speed progress up as it's nearly four years since indytechcook opened the issue by posting a patch :(

HyperGlide’s picture

++ for this feature.

greggles’s picture

I believe this is severely hampering the performance of mollom on groups.drupal.org.

Not only is this the most followed issue in the Mollom queue, it's probably also the most duplicated. Here are other issues that are ultimately duplicate issues of this one:
#1441924: Provide hook to Views Bulk Operations
#342138: Add a 'report to Mollom' action
#338510: Implement hook_node_operations() and add actions
#921772: Report to Mollom 'registered spam users accounts' and delete account

It's confusing to me that a patch is available that adds this feature and was not reviewed by a maintainer.

I'm very happy to see the recent improvements to the mollom module/service. #273964: Accessibility problems with audio CAPTCHA was a huge item to fix. This is the next big one.

Whether it's "critical" or not from a d.o issue perspective I've believe (based on the data above) that it is critical from the perspective of value to mollom users.

eshta’s picture

Hi there, greggles.

A lot of this history predates me so thank you for commenting on this and bringing it up on my radar. I'm going to take a look at the latest patch (will need a re-roll, etc.) and do some testing. It may take me a few days but we'll get this rolling again ;-)

greggles’s picture

Wonderful news. Thanks, @eshta.

HyperGlide’s picture

Thanks @eshta++ and @greggles++

eshta’s picture

Version: 7.x-2.5 » 7.x-2.x-dev
Issue summary: View changes
FileSize
2.17 KB

Re-rolling patch.

eshta’s picture

FileSize
4.76 KB

Fixed some whitespace issues and added source for feedback reporting.

Questions:
Should we really be deleting the mollom data for an unpublish action?

I was looking at the current state of the hook_mollom_form_list for comments and it seems like we might leverage this instead of simply calling things directly.

function comment_mollom_form_list() {
  $forms = array();
  foreach (node_type_get_types() as $type) {
    $form_id = "comment_node_{$type->type}_form";
    $forms[$form_id] = array(
      'title' => t('@name comment form', array('@name' => $type->name)),
      'entity' => 'comment',
      'bundle' => 'comment_node_' . $type->type,
      'delete form' => 'comment_confirm_delete',
      'delete form file' => array(
        'name' => 'comment.admin',
      ),
      'report access' => array('administer comments'),
      'entity delete multiple callback' => 'comment_delete_multiple',
      'entity report access callback' => 'comment_mollom_entity_report_access',
    );
  }
  return $forms;
}

The specifics that came to mind were:

  1. entity delete multiple callback: we should reference this definition rather than directly implementing
  2. entity report access callback: should we be checking access to comments prior to performing these actions?
eshta’s picture

This also could use a test....

eshta’s picture

FileSize
7.67 KB

Updated the patch to read delete and access callbacks from the comment form definitions so that all callbacks are called in these actions.

The last piece here is testing the actions.

FOR WATCHERS: If anyone is in need of this functionality, please test this patch :-)

greggles’s picture

It looks like this is just providing actions for comments, but not for nodes nor user accounts. On g.d.o right now the most common type of spam is nodes. Are you planning to add nodes?

eshta’s picture

We could certainly extend this to nodes pretty easily I would think using a similar approach. Probably can't get to it today but will be able to in the next day or two at most (unless you want to refactor it in before then, of course).

@greggles: Would you be able to help with testing (and perhaps a test class)?

greggles’s picture

I'm mostly an end user of mollom in my role as spam moderator on g.d.o, so unlikely to help beyond visual patch reviews/feedback.

eshta’s picture

Adding nodes is a bit more of an effort. The comment integration in place already provides delete callback handlers. Node deletion is limited to integrating with the node delete form. I'm a bit wary of just adding it in here, even with callbacks in place without lots of security checks....

I think what would be best is only having unpublish actions for nodes and comments. That is more within Mollom's area of responsibility.

Would that meet the needs?

eshta’s picture

FileSize
8.08 KB

To that end - I've attached a stab at simple unpublish actions for both comments and nodes.

eshta’s picture

  1. +++ b/mollom.module
    @@ -3950,3 +3966,181 @@ function profile_mollom_form_info_alter(&$form_info, $form_id) {
    +function mollom_action_unpublish_comment($comments, $context = array()) {
    

    Function comments are wrong here.

  2. +++ b/mollom.module
    @@ -3950,3 +3966,181 @@ function profile_mollom_form_info_alter(&$form_info, $form_id) {
    +function mollom_action_delete_comment($nodes, $context = array()) {
    

    This should be called mollom_action_unpublish_node (and needs updated comments).

eshta’s picture

FileSize
32.93 KB

Fixed based on info above.

Status: Needs review » Needs work

The last submitted patch, 40: mollom.actions.40.patch, failed testing.

eshta’s picture

Status: Needs work » Needs review
FileSize
13.14 KB

Updated for a few bug fixes and a re-roll. Also added a test of the core actions functions.

reujwils’s picture

Subscribe

eshta’s picture

So this is RTBC practically and I'm planning on rolling out a new release over the weekend that will probably include it. Any feedback from folks who think this will or won't meet their needs, please let me know so that it can be taken into account (or better yet - add on to the patch).

  • Commit e8b5758 on 7.x-2.x by eshta:
    Issue #655846 by eshta, gordon, ttkaminski: Added support for aggregate...
eshta’s picture

Issue tags: +needs backport to 6.x
eshta’s picture

FileSize
13.59 KB

Status: Needs review » Needs work

The last submitted patch, 47: mollom.actions.d6.47.patch, failed testing.

eshta’s picture

Status: Needs work » Needs review

47: mollom.actions.d6.47.patch queued for re-testing.

eshta’s picture

Version: 7.x-2.x-dev » 6.x-2.x-dev

Fixed version for backport test.

Status: Needs review » Needs work

The last submitted patch, 47: mollom.actions.d6.47.patch, failed testing.

eshta’s picture

Status: Needs work » Needs review

47: mollom.actions.d6.47.patch queued for re-testing.

eshta’s picture

Status: Needs review » Fixed

  • Commit feefe97 on 6.x-2.x by eshta:
    Issue #655846 by eshta, gordon, ttkaminski: Added support for aggregate...

Status: Fixed » Closed (fixed)

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

greggles’s picture

Thanks, eshta for the work on both 7.x and 6.x branches!