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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Issue with spamprotection 1.2.0 abstract class on


Go to End


610 Views

Avatar
tazzydemon

Community Member, 135 Posts

30 October 2014 at 4:16pm

Edited: 30/10/2014 4:24pm

I recently upgraded the spamprotection module to 1.2.0 (silverstripe 3.1.6) and in the process added the new silverstripe-spamprotection-honeypot. This new honeypot module absolutely requires that composer sets up an autoload for the namespaced classes. It doesn't say so in the docs and I was not prepared to take that jump on a live site just yet. For a laugh I refactored it without the nuisance namespace "junk" and it worked.

However, instead I refactored by simplespamprotection module which does the same and is based on an old 2.4 module.

When I came to the SimpleSpamProtectorField.php where:

class SimpleSpamProtectorField extends SpamProtectorField

It failed with "Class SpamProtectorField not found" because the SpamProtectorField defined in the spamprotection module is abstract and, I am guessing, does not get scaffolded by silverstripe and therefore cannot be found. If I remove "abstract", do a dev/build and then re-add "abstract" it works.

I think this may be an issue with abstract classes in general. For this use I simply added the contents of the abstract class and extended FormField, but I don't think I should have had to do that.