[html-formfu] HTML::FormFu::Model::DBIC t\update\create_belongs_to.t problems

Carl Franks fireartist at gmail.com
Tue Mar 1 15:39:06 GMT 2011


On 1 March 2011 13:33, Peter Shangov <pshangov at yahoo.com> wrote:
> Follow-up to my previous message:
>
> The problem is in line 426 in DBIC.pm (current version on github):
>
>  $dbic->discard_changes unless( $dbic->$rel );
>
> DBIx::Class throws an exception on $dbic->$rel if the foreign key column for $rel is undefined, except where the foreign key column has the same name as $rel, in which case undef is returned (since DBIx::Class actually executes $dbic->$column). An easy solution is simply to use eval:
>
>  $dbic->discard_changes unless( eval { $dbic->$rel } );

I've tried digging deeper to figure out what's going on - but have
become lost in DBIC's innards :(
Have pushed your suggested fix to github -thanks
Carl



More information about the HTML-FormFu mailing list