Skip Menu |

This queue is for tickets about the Maypole CPAN distribution.

Report information
The Basics
Id: 9473
Status: resolved
Priority: 0/
Queue: Maypole

People
Owner: Nobody in particular
Requestors: dhoworth [...] mrc-lmb.cam.ac.uk
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.06
Fixed in: (no value)



Subject: Maypole::Model::CDBI::related_class() is broken
David Baird reported this a while ago, but it's still broken .... Maypole::Model::CDBI::related returns a list, not a hashref. This patch seems to do the right thing, but this is at the limit of my CDBI-fu so treat with caution. Cheers, d. --- /usr/lib/perl5/site_perl/5.6.1/Maypole/Model/CDBI.pm Fri Oct 15 23:01:22 2004 +++ Maypole-Model-CDBI/lib/Maypole/Model/CDBI.pm Tue Dec 7 14:08:18 2004 @@ -80,8 +80,13 @@ sub related_class { my ( $self, $r, $accessor ) = @_; - my $related = $self->related->{$accessor}; - if ( my $mapping = $related->{args}->{mapping} ) { + + my $related = $self->meta_info( has_many => $accessor ) || + $self->meta_info( has_a => $accessor ) || + return; + + my $mapping = $related->{args}->{mapping}; + if ( @$mapping ) { return $related->{foreign_class}->meta_info('has_a')->{ $$mapping[0] } ->{foreign_class}; }
Thanks for submitting a ticket for this. It's resolved in 2.07 Simon