Skip to content

Commit

Permalink
Fixing #5555 - Aggregate Special Comment Use
Browse files Browse the repository at this point in the history
* Aggregate graph does not show other percentiles
  • Loading branch information
TheWitness committed Nov 18, 2023
1 parent 1e59b9e commit 5c88cdc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Cacti CHANGELOG
-issue#5534: When deleting a single Data Source the table data_debug is not purged
-issue#5542: When a form element does not include a 'value' column, provide a more helpful warning message
-issue#5554: Interface description with equal sign (=) in ifAlias does not show Alias
-issue#5555: Aggregate graph does not show other percentiles
-issue#5561: Settings table custom size reverted by database repair
-issue#5564: Device list empty due to SQL error
-issue#5565: Incorrect variable name in change_device cli script
Expand Down
7 changes: 4 additions & 3 deletions lib/api_aggregate.php
Original file line number Diff line number Diff line change
Expand Up @@ -1317,6 +1317,8 @@ function aggregate_create_update(&$local_graph_id, $member_graphs, $attribs) {
}

function aggregate_handle_ptile_type($member_graphs, $skipped_items, $local_graph_id, $_total, $_total_type) {
static $special_comments = null;

$comments_hrules = db_fetch_assoc('SELECT *
FROM graph_templates_item
WHERE graph_type_id IN(' . GRAPH_ITEM_TYPE_COMMENT . ',' . GRAPH_ITEM_TYPE_HRULE . ')' .
Expand All @@ -1331,14 +1333,13 @@ function aggregate_handle_ptile_type($member_graphs, $skipped_items, $local_grap

if (cacti_sizeof($comments_hrules)) {
$hrule_found = false;
$comment_found = false;

foreach ($comments_hrules as $item) {
switch($item['graph_type_id']) {
case GRAPH_ITEM_TYPE_COMMENT:
if (!$comment_found) {
if (!isset($special_comments[$item['text_format']])) {
if (preg_match('/(:bits:|:bytes:)/', $item['text_format'])) {
$comment_found = true;
$special_comments[$item['text_format']] = true;

$parts = explode('|', $item['text_format']);

Expand Down

0 comments on commit 5c88cdc

Please sign in to comment.