From 160514cfbe5acd41941de26f0ca5e31d2fa10a09 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Wed, 13 Dec 2023 10:08:13 +0100 Subject: [PATCH] fix filter bug --- pandora_console/include/functions_events.php | 7 ++++++- pandora_console/operation/events/events.php | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 747e5154ce..852d00f270 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -6472,7 +6472,12 @@ function event_print_graph( $color[] = '#82b92f'; } } else { - $interval_length = (int) ($period / $num_intervals); + $interval_length = 0; + + if ($num_intervals > 0) { + $interval_length = (int) ($period / $num_intervals); + } + $intervals = []; $intervals[0] = $start_utimestamp; for ($i = 0; $i < $num_intervals; $i++) { diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index be5f6047e3..f47fc71f55 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -1234,7 +1234,7 @@ if (is_ajax() === true) { $data = array_values( array_filter( - $data, + ($data ?? []), function ($item) { return (bool) (array) $item; }