There were 2 messages regarding format.
NOTYYYY-MM-DD and FALSEFORMAT...

The first was thrown when no application wide locale was set and the second one when it was set. This lead to the problem that people set only the first one, afterwards setting an application wide locale and then the message was not set because the false key was used.

To prevent this problematic case we unified these two messages (which were 90% identical) and added a note into the migration chapter. So simply change NOTYYYY-MM-DD to FALSEFORMAT.

Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com

----- Original Message ----- From: "holografix ." <hologra...@gmail.com>
To: "Nabble Zend Framework General" <fw-general@lists.zend.com>
Sent: Monday, September 21, 2009 5:57 PM
Subject: [fw-general] Date validator changes or bug ?


Hi
This code works fine with ZF 1.9.2 but not with latest trunk.

$startdate = new Zend_Form_Element_Text('startdate');
$startdate->setLabel('Start date:')
         ->addValidator(
               'Date', true, array(
                   'messages' => array(
                       'dateInvalidDate' => 'Invalid date',
                       'dateNotYYYY-MM-DD' => 'Invalid format'
                   )
               )
          )
          ->setAttrib('size', 10)
          ->setAttrib('maxLength', 10)
          ->setRequired(true);



With latest trunk it throws a fatal error when the form is submitted.
Fatal error: Uncaught exception 'Zend_Validate_Exception' with message 'No
message template exists for key 'dateNotYYYY-MM-DD''
in
C:\wwwroot\lib\php\ZendFramework\library\Zend\Validate\Abstract.php:153...

Is it a bug or something that has changed ?

Cheers
Holo


Reply via email to