[Catalyst] FormFu edit form problem
Toby Corkindale
toby.corkindale at strategicdata.com.au
Fri May 29 05:43:48 GMT 2009
Moritz Onken wrote:
> Do you run the latest version of DBIC?
I was running on 0.08012, however I have updated to 0.08103 and still
have the same problem.
-Toby
>> 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: Catalyst at lists.scsys.co.uk
>> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
>> Searchable archive:
>> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
>> Dev site: http://dev.catalyst.perl.org/
>
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
More information about the Catalyst
mailing list