[html-formfu] Populate form using a complex hashref?

Carl Franks fireartist at gmail.com
Mon Mar 9 09:39:18 GMT 2009


2009/3/8 Moritz Onken <onken at houseofdesign.de>:
> For HashRef to work properly I need a method to unset the values of each
> field.
> I tried that with:
>
> map { eval { $_->default(undef)  } } (grep { $_->is_field }
> @{$form->get_all_elements});
>
> which works fine, but fails on a Date element with:
>
> Invalid date format:  at lib/HTML/FormFu/Element/Date.pm line 150
>
> Is this a Date (DateTime) bug because you cannot set it to undef or should I
> try another
> way to set these fields to undef.

I think it's reasonable to be able to do $date->default( undef );
but are you sure that's what's triggering this error?

line 150 is inside a:
    elsif ( defined( $default = $self->default ) )

Carl



More information about the HTML-FormFu mailing list