Do you run the latest version of DBIC?


Hi Carl,
The patched version of 0.04004 seemed to work fine, however the released 0.05000 only works on some, but not all, of my tables.

I tracked the issue down to part of HTML::FormFu::Model::DBIC around line 534, where you do:
-----------------------
if ( exists $info->{attrs}{is_foreign_key_constraint} ) {
   $fk_constraint = $info->{attrs}{is_foreign_key_constraint};
}
...
else {
$fk_constraint = not $dbic->result_source- >compare_relationship_keys( \...@keys, \...@fpkey );
}

next if($fk_constraint);
...
croak 'The primary key and the foreign key may not be the same column in class '.$fclass if $fpkey eq $fkey;
-----------------------


The tables that break FormFu have relationships defined where the
is_foreign_key_constraint attribute is set to false. If I change it to true, everything seems to work fine.

Eg.
__PACKAGE__->belongs_to(
 gp => 'My::Schema::Result::GP',
 { id => 'gp' },
 { is_foreign_key_constraint => 0 }
);


I didn't write the DB schema so I'm not sure why they indicated these weren't foreign keys, when they are, but I still don't think FormFu should barf on them.

What do you think?

Thanks,
Toby

_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/


_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to