Merge branch '3056-Error-en-templates-wizard-de-informes-en-meta-dev' into 'develop'

Fixed Automatic combined Graph in metaconsole

See merge request artica/pandorafms!2021
This commit is contained in:
vgilc 2018-11-30 13:05:30 +01:00
commit ed615a11d0
1 changed files with 12 additions and 2 deletions

View File

@ -6353,7 +6353,17 @@ function reporting_custom_graph($report, $content, $type = 'dinamic',
}
}
else{
$modules[] = $content['id_agent_module'];
if ($content['id_agent_module']) {
$modules[] = $content['id_agent_module'];
} else {
// restore to metaconsole database
metaconsole_restore_db();
$module_source = db_get_all_rows_sql("SELECT id_agent_module FROM tgraph_source WHERE id_graph = " . $content['id_gs']);
foreach ($module_source as $key => $value) {
$modules[$key] = $value['id_agent_module'];
}
metaconsole_connect($server);
}
}
$id_graph = 0;
}
@ -6408,7 +6418,7 @@ function reporting_custom_graph($report, $content, $type = 'dinamic',
break;
}
if ($config['metaconsole'] && $type_report != 'automatic_graph') {
if ($config['metaconsole']) {
metaconsole_restore_db();
}