From c70f270d86bd667eb7127ef836a3a7f8027536e6 Mon Sep 17 00:00:00 2001 From: Will Rossiter Date: Sat, 14 Apr 2012 23:23:38 +1200 Subject: [PATCH] MINOR: hide required configuration, field validation is handled by the form field directly, not the form as things like widgets will always fail the built in validation. Fixes #6752 --- code/EditableSpamProtectionField.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/code/EditableSpamProtectionField.php b/code/EditableSpamProtectionField.php index ad82907..ef6d3bd 100644 --- a/code/EditableSpamProtectionField.php +++ b/code/EditableSpamProtectionField.php @@ -17,9 +17,19 @@ if(class_exists('EditableFormField')){ if($protector = SpamProtectorManager::get_spam_protector()) { if($protector) { $protector = new $protector(); + return $protector->getFormField($this->Name, $this->Title, null); } } + + return false; + } + + function getFieldValidationOptions() { + return new FieldSet(); + } + + function getRequired() { return false; }