From 25bed01edb0dacdf436853909a4bb5cc8e1b764b Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 7 Oct 2014 13:48:48 +0200 Subject: [PATCH] Fixed the update the tags. Ticket # 1417 --- pandora_console/include/functions_modules.php | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index eca97d4ada..3e108754de 100644 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -349,8 +349,25 @@ function modules_delete_agent_module ($id_agent_module) { * @return True if the module was updated. False if not. */ function modules_update_agent_module ($id, $values, $onlyNoDeletePending = false, $tags = false) { + + $update_tags = false; + $return_tag = true; + if ($tags !== false) { + $update_tags = true; + $return_tag = tags_update_module_tag ($id, $tags); + } + + if ($return_tag === false) { + return ERR_DB; + } + if (!is_array ($values) || empty ($values)) { - return ERR_GENERIC; + if ($update_tags) { + return true; + } + else { + return ERR_GENERIC; + } } if (isset ($values['nombre'])) { @@ -368,14 +385,7 @@ function modules_update_agent_module ($id, $values, $onlyNoDeletePending = false } } - $return_tag = true; - if ($tags !== false) { - $return_tag = tags_update_module_tag ($id, $tags); - } - if ($return_tag === false) { - return ERR_DB; - } $where = array(); $where['id_agente_modulo'] = $id;