[Maypole] 2.07 PR

Simon Flack sf@flacks.net
Tue, 18 Jan 2005 20:52:39 +0000


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