Jump to:

10928 Posts in 2612 Topics by 1809 members

All other Modules

SilverStripe Forums » All other Modules » SpamProtection/Recaptcha Error SS 2.3.7

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 243 Views
  • sw92
    Avatar
    Community Member
    2 Posts

    SpamProtection/Recaptcha Error SS 2.3.7 Link to this post

    Hi,

    I'm new to Silvertstripe. I'm working on a site that was created a few years ago on 2.3.7 but I hope someone can help me.
    I've installed Spam Protection and Recaptcha, however when i add the spam protection field to a form i get this error:

    Fatal error: Class RecaptchaProtector contains 3 abstract methods and must therefore be declared abstract or implement the remaining methods (SpamProtector::getFieldName, SpamProtector::updateForm, SpamProtector::setFieldMapping) in /home/site/public_html/chillu-recaptcha-9235a28/code/RecaptchaProtector.php on line 28

    Any Ideas?

    Cheers
    Sam

  • swaiba
    Avatar
    Forum Moderator
    1784 Posts

    Re: SpamProtection/Recaptcha Error SS 2.3.7 Link to this post

    I'd recommend you improve the world by using MathSpamProtector instead of Recaptcha...

    http://www.balbuss.com/implementing-mathspamprotection/

  • sw92
    Avatar
    Community Member
    2 Posts

    Re: SpamProtection/Recaptcha Error SS 2.3.7 Link to this post

    Thanks for replying.

    Okay so i changed over to MathSpamProtector like you advised.

    I'm still experiencing a similar problem though:

    Fatal error: Class MathSpamProtector contains 3 abstract methods and must therefore be declared abstract or implement the remaining methods (SpamProtector::getFieldName, SpamProtector::updateForm, SpamProtector::setFieldMapping) in /home/sitel/public_html/mathspamprotection/code/MathSpamProtector.php on line 42

    Also, with this last step in the instructions:

    5. in your form function enable mathspamprotection. Suppose you're creating
    a contact form, then:

    function ContactForm() {

          // ...

          $form = new Form(
             $this, 'ContactForm', $fields, $actions, $validator
          );

          // enable MathSpamProtection
          if(class_exists('SpamProtectorManager')) {
             SpamProtectorManager::update_form($form);
          }

          // now return the Form object for the template
          return $form;
    }

    Are they reffering to here: public_html/userforms/_config.php? or somehwere else?

  • swaiba
    Avatar
    Forum Moderator
    1784 Posts

    Re: SpamProtection/Recaptcha Error SS 2.3.7 Link to this post

    Are they reffering to here: public_html/userforms/_config.php?

    yep...

    if (ClassInfo::exists('MathSpamProtector') && ClassInfo::exists('SpamProtectorManager')) {
       SpamProtectorManager::set_spam_protector('MathSpamProtector');
    }

    243 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.