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

SpamProtection/Recaptcha Error SS 2.3.7


Reply


4 Posts   277 Views

Avatar
sw92

Community Member, 2 Posts

28 May 2013 at 8:19pm

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

Avatar
swaiba

Forum Moderator, 1798 Posts

28 May 2013 at 8:46pm

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

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

Avatar
sw92

Community Member, 2 Posts

29 May 2013 at 12:50am

Edited: 29/05/2013 12:50am

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?

Avatar
swaiba

Forum Moderator, 1798 Posts

29 May 2013 at 12:55am

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

yep...

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