avoid using module type read from xml once the module is created

This commit is contained in:
alejandro.campos@artica.es 2024-02-26 18:51:23 +01:00
parent 421598df6b
commit f8e2cbd7e0
1 changed files with 7 additions and 2 deletions

View File

@ -657,7 +657,12 @@ sub process_xml_data ($$$$$) {
# Unnamed module
next if ($module_name eq '');
my $module_type = get_tag_value ($module_data, 'type', 'generic_data');
# Read module type from db when module exists within it (skip XML read).
my $module_type = get_db_value ($dbh, 'SELECT ttm.nombre FROM ttipo_modulo ttm INNER JOIN tagente_modulo tam ON tam.id_tipo_modulo = ttm.id_tipo WHERE tam.id_agente = ' . $agent_id . ' AND tam.nombre' . ' = '. $RDBMS_QUOTE_STRING . safe_input($module_name) . $RDBMS_QUOTE_STRING);
if (!defined($module_type)) {
$module_type = get_tag_value ($module_data, 'type', 'generic_data');
}
# Apply timezone offset to module if timestamp is set.
if (defined($module_data->{'timestamp'} && $module_data->{'timestamp'} ne '')) {