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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

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

SpamProtection/Recaptcha Error SS 2.3.7


Go to End


4 Posts   1063 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, 1899 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, 1899 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');
}