[html-formfu] DateTime Element and default values less than 10

Carl Franks fireartist at gmail.com
Mon Jun 1 13:26:44 GMT 2009


2009/6/1 Mike Glen <mike.glen at mindsweep.net>:
> Carl Franks wrote:
>>
>> This will be related to 0-padded numbers (01, 02, etc)
>> but it should be handled correctly already.
>>
>> Can you check that you're calling $form->process() after
>> $form->model->default_values() and before rendering the form?
>>
> Thanks, that fixes it.
> I'm using catalyst and thought that $form->process() was called
> automatically by the controller.

It is, but I usually advise calling process() after
$form->model->default_values(), primarily because of the way
Date(Time) fields are built.
There are many methods documented, for which you need to call
process() again, including $form->default_values().
$field->default() (which $form->model->default_values() calls) isn't
documented as such, but maybe should be.
I can't remember if there was a consensus on whether it should be
necessary to call process(), or whether to keep fixing any
side-effects such as this, that come up.

Anyway, I've made a fix for this particular problem, in svn revision 1526.
It'll be in the next cpan release.

Cheers,
Carl



More information about the HTML-FormFu mailing list