Mollom rocks, like the rest of Drupal. ;) I think I have found a situation whereby Mollom gets bypassed. I have to override the node edit form to provide some default values and related node lookups (I would have done it all w/css and cck defaults if possible but it wasn't). This is happening in a production site with a ton of modules, so I isolated it down to a fresh install of core + mollom to verify.
I have created a custom content type called custom_type. I copied the garland theme to /sites/all/themes and used the following code to provide the name of an override for the node edit form:
function garlando_theme() {
return array(
'custom_type_node_form' => array(
'arguments' => array('form' => NULL),
),
);
}
function garlando_custom_type_node_form($form) {
$form['buttons']['submit']['#value'] = t("Anything");
return drupal_render($form);
}
The line $form['buttons']['submit']['#value'] = t("Anything"); will cause Mollom to be bypassed when I submit a new custom_type node with spammy content. I can literally change the text to anything for this to happen. IF I comment out the line $form['buttons']['submit']['#value'] = t("Anything"); then Mollom begins to work again. Whatever other mayhem I do with the form does NOT affect Mollom -- just changing the button text.
Very strange. Perhaps I shouldn't change the text of the button in this fashion anyway? Thanks!
Comments
Comment #1
dave reidCan you confirm this behavior on the latest 6.x-1.9? There were some major fixes to the form submit detection.
Comment #2
dave reidNo response so marking as fixed.
Comment #3
swellbow commentedMy apologies for not getting back forever. Confirmed that changing the button text in theme or in module hooks works great. Thanks so much!