Re: [Maypole] 2.07 PR

From: Simon Flack (sf at flacks.net)
Date: Tue Jan 18 2005 - 20:52:39 GMT


Simon Flack wrote:
> Peter Speltz wrote:
> > This isn't new to 2.07 however while we're on the subject . . . Line
> 183 in
> > Maypole::Model::Base , in the is_public sub, a warning is generated
> when there
> > aren't any attributes for the sub in question. Its annoying when
> called in a
> > loop.
> >
> > I replace line 183:
> >
> > my $attrs = join " ", attributes::get($cv);
> >
> > with these 2 lines:
> >
> > my @attrs = attributes::get($cv) || ();
> > my $attrs = join " ", @attrs;
>
> Thanks, I'll apply that.

In fact, you can also avoid those warnings by making sure your
&FETCH_CODE_ATTRIBUTES returns an empty list instead of undef, e.g.:

        sub FETCH_CODE_ATTRIBUTES { @{$remember{$_[1]} || []} }

Simon

_______________________________________________
maypole mailing list
maypole at lists.netthink.co.uk
http://lists.netthink.co.uk/listinfo/maypole



This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:57 GMT