[html-formfu] Side effect of checkbox name
Carl Franks
fireartist at gmail.com
Thu Apr 10 09:36:13 BST 2008
On 09/04/2008, Alex Povolotsky <tarkhil at over.ru> wrote:
> Hello!
>
> Trying HTML::FormFu (svn today), I've found that form for editing data with
> has_many relation cleans relation _sometimes_.
>
> After some investigation, I've discovered that
>
> - type: Checkbox
> name: delete
> value: 1
> model_config:
> DBIC:
> delete_if_true: 1
>
> cleans up relation, while
>
> - type: Checkbox
> name: del
> value: 1
> model_config:
> DBIC:
> delete_if_true: 1
>
> works ok.
>
> I guess it should be mentioned somewhere in manuals...
This is already in the docs for HTML-FormFu-Model-DBIC
<quote>
=head1 CAVEATS
To ensure your column's inflators and deflators are called, we have to
get / set values using their named methods, and not with C<get_column> /
C<set_column>.
Because of this, beware of having column names which clash with DBIx::Class
built-in method-names, such as C<delete>. - It will have obviously
undesirable results!
</quote>
This isn't really specific to FormFu - it's a general DBIC issue.
Carl
More information about the HTML-FormFu
mailing list