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

SpamProtectorManager and Comments on SS3


Reply


6 Posts   637 Views

Avatar
Pix

Community Member, 149 Posts

14 March 2013 at 1:53pm

Edited: 14/03/2013 1:56pm

Do I need to update the page comment form myself? I do not see my captcha.

In _config.php I have:

RecaptchaField::$public_api_key = 'xxxxxxxxxxxxx';
RecaptchaField::$private_api_key = 'xxxxxxxxxxxxx';
SpamProtectorManager::set_spam_protector('RecaptchaProtector');

I have modules installed: comments, SpamProtectionModule, and recaptcha

No captcha showing on page comments. Do I need to add the captcha myself, extend page comments or something and update the form like so;

$protector = SpamProtectorManager::update_form($form);

?

Thanks

Avatar
Willr

Forum Moderator, 5513 Posts

16 March 2013 at 9:53pm

You need to apply the optional extension CommentSpamProtection (https://github.com/silverstripe/silverstripe-spamprotection/blob/master/code/extensions/CommentSpamProtection.php).

Avatar
Pix

Community Member, 149 Posts

19 March 2013 at 5:24am

Oh...totally missed that. Thanks! Will to the rescue again, much appreciated :0)

Avatar
TC81

Community Member, 11 Posts

28 March 2013 at 7:28am

Sorry for the dumb question - but how does one apply that extension?

Avatar
Willr

Forum Moderator, 5513 Posts

28 March 2013 at 11:26am

http://doc.silverstripe.org/framework/en/reference/dataextension#adding-a-extension-to-a-built-in-class

Avatar
rohitbanerjee

Community Member, 7 Posts

8 January 2014 at 2:15am

In case if anyone couldn't figure out how or what to add as the extension, add the code snippet below in mysite/_config.php, assuming that SpamProtectorManager and RecaptchaField configuration is already in place.

Object::add_extension('CommentingController', 'CommentSpamProtection');

with help from Pyromanik

Cheers.