From 852ffcf492dd82b227a645dcd05e90d0450e7903 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Thu, 12 Apr 2012 12:23:18 +1200 Subject: [PATCH] MINOR MemberDatetimeOptionsetField::validate() now passes in $validator argument instead of getting it from the form, which is how other FormFields work like CompositeField --- forms/MemberDatetimeOptionsetField.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/forms/MemberDatetimeOptionsetField.php b/forms/MemberDatetimeOptionsetField.php index 052249445..edc7b37bf 100644 --- a/forms/MemberDatetimeOptionsetField.php +++ b/forms/MemberDatetimeOptionsetField.php @@ -89,12 +89,11 @@ class MemberDatetimeOptionsetField extends OptionsetField { } } - function validate() { + function validate($validator) { $value = isset($_POST[$this->name . '_custom']) ? $_POST[$this->name . '_custom'] : null; if(!$value) return true; // no custom value, don't validate // Check that the current date with the date format is valid or not - $validator = $this->form ? $this->form->getValidator() : null; require_once 'Zend/Date.php'; $date = Zend_Date::now()->toString($value); $valid = Zend_Date::isDate($date, $value); @@ -107,4 +106,4 @@ class MemberDatetimeOptionsetField extends OptionsetField { return false; } } -} \ No newline at end of file +}