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 a983f4d commit dc63f43
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,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#5572: RRD Checker timeouts to low
-issue#5573: Incorrect URL for editing graph template
Expand Down
9 changes: 5 additions & 4 deletions lib/api_aggregate.php
Original file line number Diff line number Diff line change
Expand Up @@ -1343,6 +1343,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 @@ -1356,15 +1358,14 @@ function aggregate_handle_ptile_type($member_graphs, $skipped_items, $local_grap
array($local_graph_id));

if (cacti_sizeof($comments_hrules)) {
$hrule_found = false;
$comment_found = false;
$hrule_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 dc63f43

Please sign in to comment.