[Maypole] 2.05 bug in Maypole::View::Base?

Dave Howorth dhoworth@mrc-lmb.cam.ac.uk
Tue, 04 Jan 2005 15:55:18 +0000


> Also, while checking the code in M-V-Base I noticed an oddity:
> 
>     my %args = (
>         request => $r,
>         objects => $r->objects,
>         base    => $base,
>         config  => $r->config
> 
>           # ...
>     );
>     if ($class) {
>         my $classmeta = $args{classmetadata} ||= {};
>         $classmeta->{name}              ||= $class;
> 
> I think that
>         my $classmeta = $args{classmetadata} ||= {};
> should be
>         my $classmeta = $r->template_args->{classmetadata} ||= {};
> to allow people to override the classmetadata (even to work around the 
> description problem!).

Doh, shoot first; ask questions later ...

If you make the change I suggested above, then you also need to add:
         $args{ classmetadata } = $classmeta;
at the end of the list of classmeta assignments. Then it does appear to 
work.

Cheers, Dave