Skip to content

Commit

Permalink
Item14237: Recording of `has' attributes bug fixed.
Browse files Browse the repository at this point in the history
Attributes of base classes defined purely via @isa global were not
accounted for a class. This was producing false debug warnings for
dynamically generated classes.
  • Loading branch information
vrurg committed Mar 10, 2017
1 parent 966ed62 commit 14b797e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/lib/Foswiki/Class.pm
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,11 @@ sub _getAllAttrs {
if ( defined $_WITH{$class} ) {
push @classAttrs, _getAllAttrs( @{ $_WITH{$class} } );
}
my @base = eval "\@$class\::ISA";
push @classAttrs, _getAllAttrs(@base) if @base;

# Leave uniq only attrs.
@classAttrs = keys %{ { map { $_ => 1 } @classAttrs } };
$_registeredAttrs{$class}{cached} = \@classAttrs;
}
return map { @{ $_registeredAttrs{$_}{cached} } } @_;
Expand Down

0 comments on commit 14b797e

Please sign in to comment.