From fad32cf4fbf5ad686b670f8500686d4b10ba702a Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Mon, 22 Jun 2015 11:45:45 +0200 Subject: graph: in case of aggregation, reset pi after initializing $obj Probably related to #122 --- graph.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/graph.php b/graph.php index fc1eb83..32748d6 100644 --- a/graph.php +++ b/graph.php @@ -30,8 +30,9 @@ if (GET('h') === NULL) { $typesdb = parse_typesdb_file($CONFIG['typesdb']); if ($plugin == 'aggregation') { - $pi = explode("-", GET('pi')); - $plugin = $_GET['p'] = GET('p', $pi[0]); + $aggr = true; + $pi = explode("-", GET('pi'), 2); + $plugin = GET('p', $pi[0]); } # plugin json @@ -81,6 +82,11 @@ switch ($plugin_json[$type]['type']) { break; } +# in case of aggregation, reset pi after initializing $obj to get a correct title +if ($aggr) { + $_GET['pi'] = GET('pi', $pi[1]); +} + if (isset($typesdb[$type])) { $obj->data_sources = array(); foreach ($typesdb[$type] as $ds => $property) { -- cgit v1.1