diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 3c3fdac33f..78b1809e46 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2011-03-16 Sancho Lerena + + * operation/agentes/estado_monitores.php: Fixed an ugly error when cannot + get the policy name. Show unknown in that case, avoiding the SQL error. + 2011-03-14 Miguel de Dios * godmode/reporting/reporting_builder.preview.php: fixed a typing error. diff --git a/pandora_console/operation/agentes/estado_monitores.php b/pandora_console/operation/agentes/estado_monitores.php index 430c9b6c5e..fd3db53597 100644 --- a/pandora_console/operation/agentes/estado_monitores.php +++ b/pandora_console/operation/agentes/estado_monitores.php @@ -205,7 +205,12 @@ foreach ($modules as $module) { if ($module["id_policy_module"] != 0) { $linked = isModuleLinked($module['id_agente_modulo']); $id_policy = get_db_value_sql('SELECT id_policy FROM tpolicy_modules WHERE id = '.$module["id_policy_module"]); - $name_policy = get_db_value_sql('SELECT name FROM tpolicies WHERE id = '.$id_policy); + + if ($id_policy != "") + $name_policy = get_db_value_sql('SELECT name FROM tpolicies WHERE id = '.$id_policy); + else + $name_policy = __("Unknown"); + $policyInfo = infoModulePolicy($module["id_policy_module"]); $adopt = false;