Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Spam Protection Module & Math Spam Protection Crash


3 Posts   253 Views


12 February 2014 at 8:43pm (Last edited: 12 February 2014 8:50pm), Community Member, 18 Posts

currently getting this error while trying to setup Math Spam Protection really don't know where to go from here.

Fatal error: Declaration of MathSpamProtector::getFormField() must be compatible with that of SpamProtector::getFormField() in /home/ifif1773/public_html/silverstripe/mathspamprotection/code/MathSpamProtector.php on line 7

Running SS 3.1
Have both required modules installed


public function ContactForm() {
$fields = new FieldList(
new TextField('Name', 'Your Full Name'),
new EmailField('Email', 'Your Email'),
new TextField('Phone', 'Your Phone No.'),
new TextField('Subject', 'The Subject'),
new TextareaField('Message','Message')
$validator = new RequiredFields(array('Name','Email','Message'));
$actions = new FieldList(FormAction::create("sendEmail")->setTitle("Send Email"));
$form = new Form($this, 'ContactForm', $fields, $actions, $validator);
// enable MathSpamProtection
$protector = SpamProtectorManager::update_form($form);
return $form;



//Set Spam Protection

I should note that the form works fine without the:

// enable MathSpamProtection
$protector = SpamProtectorManager::update_form($form);


15 February 2014 at 11:01pm Forum Moderator, 5511 Posts

Make sure you have the latest versions of both the modules.


17 February 2014 at 7:28pm Community Member, 18 Posts

I had updated to the masters of both modules with no luck, but the new changes have resolved my issue. Thanks Will.