It would be handy to allow other modules to implement a hook to add in other forms for Mollom to protect.

At present the only way is to hack the _mollom_protectable_forms() function to add new forms in if a module_exists()

Not very Drupal like!

Comments

budda’s picture

Would also need a way to provide data during the analysis validation phase in mollom_validate_analysis()

Currently there are two types of checks, but the 2nd one builds a function name which might be dynamic too using an ID in the form name.

  $pos = strpos($form_id, '_node_form');
  if ($pos !== FALSE) {
    // The node forms use dynamic form IDs so must use a special
    // case for these.
    $data = mollom_data_node_form($form_state['values']);
  }
  else {
    $function = 'mollom_data_'. $form_id;
    if (function_exists($function)) {
      $data = $function($form_state['values']);
    }
  }
budda’s picture

Whilst learning how the mollom.module worked I wrote up a short guide on how to support other forms via a custom module over at http://www.ixis.co.uk/blog/mollom-support-custom-forms

Might be helpful for others needing a quick fix.

dave reid’s picture

Status: Active » Closed (duplicate)