Zend Framework

Float validator, assigned to text element via ini config, created in a way so that it is not locale-aware

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.9.0
  • Fix Version/s: 1.10.0
  • Component/s: Zend_Form
  • Labels:
    None

Description

Element.php, line 2000

$instance = new $name;

This way Zenf_Validator_Float::__construct gets no locale passed and failes validations for i18n numbers.

Activity

Hide
Thomas Weidner added a comment -

No bug of Zend_Form.
Simply give the option when adding the validator:

Example:

$element->addValidator('Float', 'cn_ZH');
Show
Thomas Weidner added a comment - No bug of Zend_Form. Simply give the option when adding the validator: Example:
$element->addValidator('Float', 'cn_ZH');
Hide
Kostya L. added a comment -

Form definition stored in INI, and locale stored in registry in Zend_Locale key.

http://framework.zend.com/manual/en/zend.validate.set.html#zend.validate.set.float

says

Since Zend Framework 1.8 this validator takes into account the actual locale from browser, environment or application wide set locale.

So I expect it to work without any form element manipulations in actions.

Show
Kostya L. added a comment - Form definition stored in INI, and locale stored in registry in Zend_Locale key. http://framework.zend.com/manual/en/zend.validate.set.html#zend.validate.set.float says
Since Zend Framework 1.8 this validator takes into account the actual locale from browser, environment or application wide set locale.
So I expect it to work without any form element manipulations in actions.
Hide
Thomas Weidner added a comment -

No, this feature was reverted with 1.9 as many people had problems with this automatism.

Show
Thomas Weidner added a comment - No, this feature was reverted with 1.9 as many people had problems with this automatism.
Hide
Kostya L. added a comment -

reverting is cool, keep doing this way

Show
Kostya L. added a comment - reverting is cool, keep doing this way
Hide
Thomas Weidner added a comment -

Fixed with r17798

Show
Thomas Weidner added a comment - Fixed with r17798

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: