fixes
This commit is contained in:
parent
33a3661958
commit
1328492c64
|
@ -31,7 +31,7 @@ use warnings;
|
|||
require ZoneMinder::Base;
|
||||
require Date::Manip;
|
||||
|
||||
use parent qw(ZoneMinder::Object);;
|
||||
use parent qw(ZoneMinder::Object);
|
||||
#our @ISA = qw(ZoneMinder::Object);
|
||||
|
||||
use vars qw/ $table $primary_key /;
|
||||
|
@ -114,8 +114,8 @@ sub Execute {
|
|||
$sql =~ s/zmSystemLoad/$load/g;
|
||||
}
|
||||
|
||||
my $sth = $$self{dbh}->prepare_cached( $sql )
|
||||
or Fatal( "Can't prepare '$sql': ".$$self{dbh}->errstr() );
|
||||
my $sth = $ZoneMinder::Database::dbh->prepare_cached( $sql )
|
||||
or Fatal( "Can't prepare '$sql': ".$ZoneMinder::Database::dbh->errstr() );
|
||||
my $res = $sth->execute();
|
||||
if ( !$res )
|
||||
{
|
||||
|
|
|
@ -49,6 +49,12 @@ sub new {
|
|||
|
||||
my $self = {};
|
||||
bless $self, $parent;
|
||||
no strict 'refs';
|
||||
my $primary_key = ${$parent.'::primary_key'};
|
||||
if ( ! $primary_key ) {
|
||||
Error( 'NO primary_key for type ' . $parent );
|
||||
return;
|
||||
} # end if
|
||||
if ( ( $$self{$primary_key} = $id ) or $data ) {
|
||||
#$log->debug("loading $parent $id") if $debug or DEBUG_ALL;
|
||||
$self->load( $data );
|
||||
|
|
Loading…
Reference in New Issue