From f5f859faff9fc28adff4de382dec0c4480c37ad2 Mon Sep 17 00:00:00 2001
From: zarzuelo <zarzuelo@gmail.com>
Date: Fri, 8 Oct 2010 07:22:54 +0000
Subject: [PATCH] 2010-10-08  Sergio Martin <sergio.martin@artica.es>

	* include/functions_db.php: Fixed the function get_agentmodule_id
	to avoid the pending_delete modules



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3369 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
---
 pandora_console/ChangeLog                | 5 +++++
 pandora_console/include/functions_db.php | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog
index c69cc81cbb..be55ffcd9f 100644
--- a/pandora_console/ChangeLog
+++ b/pandora_console/ChangeLog
@@ -1,3 +1,8 @@
+2010-10-08  Sergio Martin <sergio.martin@artica.es>
+
+	* include/functions_db.php: Fixed the function get_agentmodule_id
+	to avoid the pending_delete modules
+
 2010-10-08  Sergio Martin <sergio.martin@artica.es>
 
 	*  godmode/agentes/module_manager_editor_common.php
diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php
index dd54617247..7fcb9ec0f7 100644
--- a/pandora_console/include/functions_db.php
+++ b/pandora_console/include/functions_db.php
@@ -572,7 +572,7 @@ function get_agentmodule ($id_agentmodule) {
  * @return int the agentmodule id
  */
 function get_agentmodule_id ($agentmodule_name, $agent_id) {
-	return get_db_row_filter ('tagente_modulo', array('nombre' => $agentmodule_name, 'id_agente' => $agent_id)); 
+	return get_db_row_filter ('tagente_modulo', array('nombre' => $agentmodule_name, 'id_agente' => $agent_id, 'delete_pending' => 0)); 
 }
 
 /**