Changing Save button text bypasses Mollom

swellbow - May 22, 2009 - 20:07
Project:Mollom
Version:6.x-1.7
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

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:

<?php
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!

#1

Dave Reid - July 30, 2009 - 22:22
Status:active» postponed (maintainer needs more info)

Can you confirm this behavior on the latest 6.x-1.9? There were some major fixes to the form submit detection.

#2

Dave Reid - October 13, 2009 - 22:08
Status:postponed (maintainer needs more info)» fixed

No response so marking as fixed.

#3

swellbow - October 14, 2009 - 14:29

My apologies for not getting back forever. Confirmed that changing the button text in theme or in module hooks works great. Thanks so much!

#4

System Message - October 28, 2009 - 14:30
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.