Merge branch 'ent-12719-se-crean-agentes-por-duplicado-en-tagente-cuando-vienen-xmls-a-un-pandora-con-licencia-de' into 'develop'

#12719. Fix creating duplicated agents on tagente

See merge request artica/pandorafms!6881
This commit is contained in:
Matias Didier 2024-01-25 14:24:55 +00:00
commit 0b9aaa6b04
1 changed files with 4 additions and 2 deletions

View File

@ -418,8 +418,10 @@ sub process_xml_data ($$$$$) {
# A module with No-learn mode (modo = 0) creates its modules on database only when it is created
my $new_agent = 0;
# Get agent id
my $agent_id = get_agent_id ($dbh, $agent_name);
# Get agent id from tagente.
my $agent_id = get_db_value ($dbh, "SELECT id_agente FROM tagente WHERE nombre = ?", safe_input($agent_name));
$agent_id = -1 unless defined($agent_id);
my $group_id = 0;
if ($agent_id < 1) {
if ($pa_config->{'autocreate'} == 0) {