ZF-8453: Zend_Dojo_Form_Element_NumberTextBox doesn't allow more than one constraint
Description
It's not possible to use setPattern then subsequently setConstraint on a Zend_Dojo_Form_Element_NumberTextBox.
setPattern uses set constraint to add a pattern as a constraint then setConstraint overwrites the previous setPattern(setConstraint).
Comments
Posted by Robert Basic (robertbasic) on 2011-04-25T13:44:11.000+0000
Actually, this is not related to specifically to Zend_Dojo_Form_Element_NumberTextBox but to Zend_Dojo_Form_Element_ValidationTextBox
To describe more closely the issue, a few examples:
Will generate the the constraints, as expected, for "places", "pattern" and "locale".
But, on the other hand:
will generate constraints only for the "places".
Even if the method name is setConstraints, what it is actually doing is adding constraints, so the second example should generate the same result as the first one.
Posted by Robert Basic (robertbasic) on 2011-04-25T13:44:49.000+0000
Patch and tests attached.
Posted by Matthew Weier O'Phinney (matthew) on 2011-05-02T19:28:58.000+0000
Patches reviewed and applied to trunk and 1.11 release branch.
Posted by Robert Basic (robertbasic) on 2011-07-28T15:29:15.000+0000
Pull request for porting the patch in ZF2 is sent: https://github.com/zendframework/zf2/pull/272