Merge branch 'ma2sim-develop-patch-81134' into 'develop'

Change return value of function agents_get_agent_id_by_alias when alias is ''

See merge request artica/pandorafms!5498
This commit is contained in:
Rafael Ameijeiras 2023-06-29 08:35:28 +00:00
commit f5f86c9fa2
1 changed files with 2 additions and 2 deletions

View File

@ -165,9 +165,9 @@ function agents_locate_agent(string $field)
function agents_get_agent_id_by_alias($alias, $is_metaconsole=false)
{
if ($is_metaconsole === true) {
return db_get_all_rows_sql("SELECT id_tagente FROM tmetaconsole_agent WHERE upper(alias) LIKE upper('%$alias%')");
return db_get_all_rows_sql("SELECT id_tagente FROM tmetaconsole_agent WHERE '$alias' != '' and upper(alias) LIKE upper('%$alias%')");
} else {
return db_get_all_rows_sql("SELECT id_agente FROM tagente WHERE upper(alias) LIKE upper('%$alias%')");
return db_get_all_rows_sql("SELECT id_agente FROM tagente WHERE '$alias' != '' and upper(alias) LIKE upper('%$alias%')");
}
}