[html-formfu] DBIx-Class-HTML-FormFu nested-params

Carl Franks fireartist at gmail.com
Tue Nov 6 09:04:33 GMT 2007


On 05/11/2007, Mario Minati <mario.minati at googlemail.com> wrote:
>
> I think there is a problem in your rewritten code for populate_from_formfu:
>
> If you have a form that only shows part of the columns, you force the unused
> columns to undef.
> That might change db entries in an unexpected way.
>
>         my $value = defined $field
>             ? $form->param( $field->nested_name )
>             : ( grep { $col eq $_ } @valid )
>                 ? $form->param( $col )
>                 : undef;
>
> I would suggest to do
>         next unless defined $field;
> instead.

This shouldn't be a problem, as the only time it's updated with an
undefined value is if there's a Checkbox field with the same name on
the form.

I've added a test for this though - so that's cool.

Cheers,
Carl



More information about the HTML-FormFu mailing list