Issues

ZF-6623: Min and Max swapped in Zend_Validate_StringLength when building a form from a Zend_Config

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"

Comments

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

Feature implemented with r18058.