Updated to correctly invoke superclass constructor.

This commit is contained in:
Chris 2012-08-09 12:29:58 +01:00
parent 06a417790a
commit 857aeaa179
4 changed files with 9 additions and 23 deletions

View File

@ -66,11 +66,8 @@ use constant ADMIN_TYPE => 3; # User type for admin users.
sub new {
my $invocant = shift;
my $class = ref($invocant) || $invocant;
my $self = {
@_,
};
return bless $self, $class;
return $class -> SUPER::new(@_);
}

View File

@ -57,11 +57,7 @@ use AuthMethods;
sub new {
my $invocant = shift;
my $class = ref($invocant) || $invocant;
my $self = {
@_,
};
return bless $self, $class;
return $class -> SUPER::new(@_);
}

View File

@ -40,18 +40,15 @@ use Module::Load;
sub new {
my $invocant = shift;
my $class = ref($invocant) || $invocant;
my $self = {
@_,
};
my $self = $class -> SUPER::new(@_);
return undef if(!$self);
# Ensure that we have objects that we need
return SystemModule::set_error("cgi object not set") unless($self -> {"cgi"});
return SystemModule::set_error("dbh object not set") unless($self -> {"dbh"});
return SystemModule::set_error("settings object not set") unless($self -> {"settings"});
return SystemModule::set_error("app object not set") unless($self -> {"app"});
return SystemModule::set_error("logger object not set") unless($self -> {"logger"});
return bless $self, $class;
return $self;
}
@ -152,4 +149,3 @@ sub load_method {
}
1;

View File

@ -40,11 +40,8 @@ use base qw(SystemModule);
sub new {
my $invocant = shift;
my $class = ref($invocant) || $invocant;
my $self = {
@_,
};
return bless $self, $class;
return $class -> SUPER::new(@_);
}