diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 91b87ca216..92dc3f84ab 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2011-07-20 Sergio Martin + + * godmode/agentes/planned_downtime.php: Fixed a empty group array + bug + 2011-07-20 Sergio Martin * DEBIAN/control diff --git a/pandora_console/godmode/agentes/planned_downtime.php b/pandora_console/godmode/agentes/planned_downtime.php index 8eb59db83e..73b48e6298 100644 --- a/pandora_console/godmode/agentes/planned_downtime.php +++ b/pandora_console/godmode/agentes/planned_downtime.php @@ -362,9 +362,15 @@ else { $table->align[6] = "center"; $table->align[7] = "center"; $table->align[8] = "center"; - - $sql = "SELECT * FROM tplanned_downtime WHERE id_group IN (" . implode (",", array_keys ($groups)) . ")"; - $downtimes = db_get_all_rows_sql ($sql); + + if(!empty($groups)) { + $sql = "SELECT * FROM tplanned_downtime WHERE id_group IN (" . implode (",", array_keys ($groups)) . ")"; + $downtimes = db_get_all_rows_sql ($sql); + } + else { + $downtimes = array(); + } + if (!$downtimes) { echo '
'.__('No planned downtime').'
'; }