studiobonito / silverstripe-spamprotection-honeypot

Provide Honeypot spam protection for SilverStripe CMS.
Other
7 stars 17 forks source link

Namespace stuff breaks things? #1

Closed mschilder closed 9 years ago

mschilder commented 9 years ago

Hi there,

Only after removing namespace, use and / before HiddenField and SpamProtector in HoneypotField.php and HoneypotSpamProtector I got this module to work. Is this an improvement that needs to be added?

This is what it looks like now:

<?php

class HoneypotSpamProtector implements SpamProtector

and

<?php

class HoneypotField extends HiddenField
nedmas commented 9 years ago

Hi @mschilder,

The simple answer to your question is no. The namespacing is a very deliberate feature of this module. However if the namespacing is causing an issue I'd like to work out why.

Could you give more details about any errors you received. Also are you using composer?

mschilder commented 9 years ago

Before my changes the javascript for the EditableSpamProtectionField was added, but NOT the field itself. Only after my changes the two EditableSpamProtectionFields were added.

nedmas commented 9 years ago

Ok have you configured the default spam protector with the fully qualified class name?

---
name: spamprotection
---
FormSpamProtectionExtension:
  default_spam_protector: StudioBonito\SilverStripe\SpamProtection\Honeypot\SpamProtector\HoneypotSpamProtector
mschilder commented 9 years ago

No I had not. Now I have and it works flawless. Thanks for you help!

On Thursday 4 December 2014 at 16:55, Tom Densham wrote:

Ok have you configured the default spam protector with the fully qualified class name? --- name: spamprotection --- FormSpamProtectionExtension: default_spam_protector: StudioBonito\SilverStripe\SpamProtection\Honeypot\SpamProtector\HoneypotSpamProtector

— Reply to this email directly or view it on GitHub (https://github.com/studiobonito/silverstripe-spamprotection-honeypot/issues/1#issuecomment-65653017).

nedmas commented 9 years ago

No problem glad to help :-)