From 878358c9938433ae49ae9779a2a9c4418722024b Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Wed, 28 Apr 2010 11:03:07 +0000 Subject: [PATCH] 2010-04-28 Sergio Martin * include/functions_visual_map.php: fixed the error of divided by zero and now the widget display an error message. Bug #2992370 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2623 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 ++++++ pandora_console/include/functions_visual_map.php | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index e942f92a17..2dba55e8e0 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2010-04-28 Sergio Martin + + * include/functions_visual_map.php: fixed the + error of divided by zero and now the widget + display an error message. Bug #2992370 + 2010-04-28 Sancho Lerena * include/pChart/pData.class, diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 1f5329b6eb..b7d88201dd 100644 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -330,6 +330,11 @@ function print_pandora_visual_map ($id_layout, $show_links = true, $draw_lines = global $config; $layout = get_db_row ('tlayout', 'id', $id_layout); + if(($layout["width"] == 0)){ + print_error_message (__('The map has not elements')); + $layout["width"] = 1; + } + $resizedMap = false; $proportion = 1; if (!is_null($width)) {