From 5d63bc47cc580ff1b8a99cb459fc7e4df6e1e0ea Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 23 Jun 2017 10:22:37 -0400 Subject: [PATCH 1/2] I believe level should be effectiveLevel here --- scripts/ZoneMinder/lib/ZoneMinder/Logger.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm b/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm index ee1022263..44c7f7e8e 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm @@ -375,8 +375,8 @@ sub level { $this->{effectiveLevel} = $this->{termLevel} if ( $this->{termLevel} > $this->{effectiveLevel} ); $this->{effectiveLevel} = $this->{databaseLevel} if ( $this->{databaseLevel} > $this->{effectiveLevel} ); $this->{effectiveLevel} = $this->{fileLevel} if ( $this->{fileLevel} > $this->{effectiveLevel} ); - $this->{effectiveLevel} = $this->{syslogLevel} if ( $this->{syslogLevel} > $this->{level} ); - $this->{effectiveLevel} = $this->{level} if ( $this->{effectiveLevel} > $this->{level} ); + $this->{effectiveLevel} = $this->{syslogLevel} if ( $this->{syslogLevel} > $this->{effectiveLevel} ); + $this->{effectiveLevel} = $this->{level} if ( $this->{effectiveLevel} > $this->{effectiveLevel} ); } return( $this->{level} ); } From a263de144b5602008973aa2ac434185cb975bcf0 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 29 Jun 2017 15:00:17 -0400 Subject: [PATCH 2/2] fixup defaults for Filter --- web/includes/Filter.php | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/web/includes/Filter.php b/web/includes/Filter.php index 86e7084b0..59988430d 100644 --- a/web/includes/Filter.php +++ b/web/includes/Filter.php @@ -59,7 +59,8 @@ public $defaults = array( if ( array_key_exists( $fn, $this ) ) { return $this->{$fn}; } else if ( array_key_exists( $fn, $this->defaults ) ) { - return $this->defaults{$fn}; + $this->{$fn} = $this->defaults{$fn}; + return $this->{$fn}; } else { $backTrace = debug_backtrace(); @@ -71,29 +72,40 @@ public $defaults = array( public function terms( ) { if ( func_num_args( ) ) { - $this->{'Query'}['terms'] = func_get_arg(0); + $this->Query()['terms'] = func_get_arg(0); } - return $this->{'Query'}['terms']; + if ( isset( $this->Query()['terms'] ) ) { + return $this->Query()['terms']; + } + return array(); } // The following three fields are actually stored in the Query public function sort_field( ) { if ( func_num_args( ) ) { - $this->{'Query'}['sort_field'] = func_get_arg(0); + $this->Query()['sort_field'] = func_get_arg(0); } - return $this->{'Query'}['sort_field']; + if ( isset( $this->Query()['sort_field'] ) ) { + return $this->{'Query'}['sort_field']; + } + return $this->defaults{'sort_field'}; } public function sort_asc( ) { if ( func_num_args( ) ) { $this->{'Query'}['sort_asc'] = func_get_arg(0); } - return $this->{'Query'}['sort_asc']; + if ( isset( $this->Query()['sort_asc'] ) ) { + return $this->{'Query'}['sort_asc']; + } + return $this->defaults{'sort_asc'}; } public function limit( ) { if ( func_num_args( ) ) { $this->{'Query'}['limit'] = func_get_arg(0); } - return $this->{'Query'}['limit']; + if ( isset( $this->Query()['limit'] ) ) + return $this->{'Query'}['limit']; + return $this->defaults{'limit'}; } public static function find_all() {