Jump to:

10931 Posts in 2614 Topics by 1810 members

All other Modules

SilverStripe Forums » All other Modules » Spam Protection Module & Math Spam Protection Crash

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 216 Views
  • Rossel
    Avatar
    Community Member
    18 Posts

    Spam Protection Module & Math Spam Protection Crash Link to this post

    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

    contact.php

    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;
    }

    contact.ss

    $ContactForm

    mysite/config

    //Set Spam Protection
    SpamProtectorManager::set_spam_protector('MathSpamProtector');

    I should note that the form works fine without the:

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

  • Willr
    Avatar
    Forum Moderator
    5490 Posts

    Re: Spam Protection Module & Math Spam Protection Crash Link to this post

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

  • Rossel
    Avatar
    Community Member
    18 Posts

    Re: Spam Protection Module & Math Spam Protection Crash Link to this post

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

    216 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.