Can't use superclass constructor; objects may not be avilable.
This commit is contained in:
parent
61cca195da
commit
6f756e4131
@ -66,8 +66,13 @@ use constant ADMIN_TYPE => 3; # User type for admin users.
|
||||
sub new {
|
||||
my $invocant = shift;
|
||||
my $class = ref($invocant) || $invocant;
|
||||
# Note this doesn't use the superclass constructor, as it may be called before
|
||||
# the objects the superclass checks for are acutally available
|
||||
my $self = {
|
||||
@_,
|
||||
};
|
||||
|
||||
return $class -> SUPER::new(@_);
|
||||
return bless $self, $class;
|
||||
}
|
||||
|
||||
|
||||
|
8
Auth.pm
8
Auth.pm
@ -57,7 +57,13 @@ use AuthMethods;
|
||||
sub new {
|
||||
my $invocant = shift;
|
||||
my $class = ref($invocant) || $invocant;
|
||||
return $class -> SUPER::new(@_);
|
||||
# Note this doesn't use the superclass constructor, as it may be called before
|
||||
# the objects the superclass checks for are acutally available
|
||||
my $self = {
|
||||
@_,
|
||||
};
|
||||
|
||||
return bless $self, $class;
|
||||
}
|
||||
|
||||
|
||||
|
@ -40,8 +40,13 @@ use base qw(SystemModule);
|
||||
sub new {
|
||||
my $invocant = shift;
|
||||
my $class = ref($invocant) || $invocant;
|
||||
# Note this doesn't use the superclass constructor, as it may be called before
|
||||
# the objects the superclass checks for are acutally available
|
||||
my $self = {
|
||||
@_,
|
||||
};
|
||||
|
||||
return $class -> SUPER::new(@_);
|
||||
return bless $self, $class;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user