Skip to content
This repository
Browse code

MINOR MemberDatetimeOptionsetField::validate() now passes in $validat…

…or argument instead of getting it from the form, which is how other FormFields work like CompositeField
  • Loading branch information...
commit 852ffcf492dd82b227a645dcd05e90d0450e7903 1 parent 3c70ea4
Sean Harvey authored

Showing 1 changed file with 2 additions and 3 deletions. Show diff stats Hide diff stats

  1. 5  forms/MemberDatetimeOptionsetField.php
5  forms/MemberDatetimeOptionsetField.php
@@ -89,12 +89,11 @@ function setValue($value) {
89 89
 		}
90 90
 	}
91 91
 
92  
-	function validate() {
  92
+	function validate($validator) {
93 93
 		$value = isset($_POST[$this->name . '_custom']) ? $_POST[$this->name . '_custom'] : null;
94 94
 		if(!$value) return true; // no custom value, don't validate
95 95
 
96 96
 		// Check that the current date with the date format is valid or not
97  
-		$validator = $this->form ? $this->form->getValidator() : null;
98 97
 		require_once 'Zend/Date.php';
99 98
 		$date = Zend_Date::now()->toString($value);
100 99
 		$valid = Zend_Date::isDate($date, $value);
@@ -107,4 +106,4 @@ function validate() {
107 106
 			return false;
108 107
 		}
109 108
 	}
110  
-}
  109
+}

0 notes on commit 852ffcf

Please sign in to comment.
Something went wrong with that request. Please try again.