Merge branch 'ent-10000-error-500-en-llamada-api-tree_agents' into 'develop'

Ent 10000 error 500 en llamada api tree agents

See merge request artica/pandorafms!5325
This commit is contained in:
Rafael Ameijeiras 2022-12-13 10:48:15 +00:00
commit 30eac6dc6e

View File

@ -904,7 +904,7 @@ function api_get_tree_agents($trash1, $trahs2, $other, $returnType)
global $module_field_column_mampping; global $module_field_column_mampping;
// module related field mappings 2/2 (output field => column for 'tagente_estado') // module related field mappings 2/2 (output field => column for 'tagente_estado')
global $estado_fields_to_columns_mapping; global $estado_fields_to_columns_mapping;
// alert related field mappings (output field => column for 'talert_template_modules', ... ) // alert related field mappings (output field => column for 'talert_template_modules', ... )
$alert_fields_to_columns_mapping = [ $alert_fields_to_columns_mapping = [
@ -1016,9 +1016,9 @@ function api_get_tree_agents($trash1, $trahs2, $other, $returnType)
$groups = []; $groups = [];
} }
$groups = str_replace('\n', $returnReplace, $groups);
foreach ($groups as &$group) { foreach ($groups as &$group) {
$group = str_replace('\n', $returnReplace, $group);
$group['type_row'] = 'group'; $group['type_row'] = 'group';
$returnVar[] = $group; $returnVar[] = $group;
@ -1034,9 +1034,9 @@ function api_get_tree_agents($trash1, $trahs2, $other, $returnType)
$agents = []; $agents = [];
} }
$agents = str_replace('\n', $returnReplace, $agents);
foreach ($agents as $index => &$agent) { foreach ($agents as $index => &$agent) {
$agent = str_replace('\n', $returnReplace, $agent);
$agent['type_row'] = 'agent'; $agent['type_row'] = 'agent';
$returnVar[] = $agent; $returnVar[] = $agent;
@ -1063,9 +1063,9 @@ function api_get_tree_agents($trash1, $trahs2, $other, $returnType)
$modules = []; $modules = [];
} }
$modules = str_replace('\n', $returnReplace, $modules);
foreach ($modules as &$module) { foreach ($modules as &$module) {
$module = str_replace('\n', $returnReplace, $module);
$module['type_row'] = 'module'; $module['type_row'] = 'module';
if ($module['module_macros']) { if ($module['module_macros']) {
@ -1097,9 +1097,8 @@ function api_get_tree_agents($trash1, $trahs2, $other, $returnType)
$alerts = []; $alerts = [];
} }
$alerts = str_replace('\n', $returnReplace, $alerts);
foreach ($alerts as &$alert) { foreach ($alerts as &$alert) {
$alert = str_replace('\n', $returnReplace, $alert);
$alert['type_row'] = 'alert'; $alert['type_row'] = 'alert';
$returnVar[] = $alert; $returnVar[] = $alert;
} }