[html-formfu] refactoring defaults_from_model (DBIC)

Carl Franks fireartist at gmail.com
Mon Jan 14 13:04:47 GMT 2008


On 14/01/2008, Brian Cassidy <brian.cassidy at nald.ca> wrote:
> Carl Franks wrote:
> > On 12/01/2008, Zbigniew Lukasiak <zzbbyy at gmail.com> wrote:
> >>
> >> I've changed defaults_from_model. Instead of scanning the db fields of
> >> the given row and then matching them against form fields - I made it
> >> walk through the form fields and match them against the db fields.
>
> (Note, I haven't looked at your code yet)
>
> Depending on how you do this it could bring back the "delete" bug,
> where-in a form element named "delete" would actually execute the
> "delete" method on the dbic object, thereby removing the row from the
> database.
>
> You're probably well-aware of the issue, but I just want to state it to
> the list to be safe. :)

That bug is already back - intentionally :)
Using get/set_column() was no use, because dbic inflators / deflators
weren't being called.
I'm pretty sure our docs just mention to not use columns with dbic
built-in names.

Carl



More information about the HTML-FormFu mailing list