From 304b165ddc497e8ff08d87e70fe9703fa01ebd71 Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Thu, 7 Oct 2010 08:46:13 +0000 Subject: [PATCH] 2010-10-07 Sergio Martin * include/fgraph.php: Fixed crash when try to render a graph without data git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3359 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/include/fgraph.php | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index e2581c5cc3..429cb7c96d 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2010-10-07 Sergio Martin + + * include/fgraph.php: Fixed crash when try to render + a graph without data + 2010-10-07 Sergio Martin * godmode/massive/massive_edit_agents.php: Removed the IP diff --git a/pandora_console/include/fgraph.php b/pandora_console/include/fgraph.php index 6e851200a2..88b568d03a 100644 --- a/pandora_console/include/fgraph.php +++ b/pandora_console/include/fgraph.php @@ -228,7 +228,10 @@ function graphic_combined_module ($module_list, $weight_list, $period, $width, $ $min_necessary = 2; } - + + // Set initial conditions + $graph_values[$i] = array(); + // Check available data if (count ($data) < $min_necessary) { continue; @@ -240,8 +243,6 @@ function graphic_combined_module ($module_list, $weight_list, $period, $width, $ // Event iterator $k = 0; - // Set initial conditions - $graph_values[$i] = array(); if ($data[0]['utimestamp'] == $datelimit) { $previous_data = $data[0]['datos']; $j++; @@ -324,7 +325,7 @@ function graphic_combined_module ($module_list, $weight_list, $period, $width, $ $title_period = __('Last %s days', format_numeric (($period / (3600 * 24)), 2)); $time_format = 'M j'; } - + if (! $graphic_type) { return fs_combined_chart ($graph_values, $graph, $module_name_list, $width, $height, $stacked, $resolution / 10, $time_format); }