Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.7.1
-
Fix Version/s: 1.10.0
-
Component/s: Zend_Form, Zend_Validate
-
Labels:None
Description
Creating a form via a Zend_Config...
(snippet)
events.event1.accept.elements.firstName.type = "text"
events.event1.accept.elements.firstName.options.label = "First Name"
events.event1.accept.elements.firstName.required = true
events.event1.accept.elements.firstName.options.validators.strlen.validator = "StringLength"
events.event1.accept.elements.firstName.options.validators.strlen.options.max = "35"
events.event1.accept.elements.firstName.options.validators.strlen.options.min = "1"
(end snippet)
max and min are swapped in the resulting validator - verified by dumping the object.
With the values above, an exception is thrown complaining "The maximum must be greater than or equal to the minimum length, but 1 < 35"
As note:
The problem is that StringLength defines min as first parameter and max as second.
So to have a quick workaround you should switch min and max in your ini file to get it working.
For the future we already have a solution which should be ready for 1.9