Aggregate v0.75 - Color Bug

Discussions on developing plugins for the Cacti Plugin Architecture

Moderators: Developers, Moderators

Post Reply
Caspa
Posts: 1
Joined: Mon Mar 03, 2014 3:35 pm

Aggregate v0.75 - Color Bug

Post by Caspa »

I found a bug with the colors while creating a graph, if I removed an item from a color template, and then added it back in, that new color would always be at the end regardless of the sequence. Digging into the aggregate.php I found at line 181-184:

Code: Select all

$sql = "SELECT color_id " .
"FROM plugin_aggregate_color_template_items " .
"WHERE color_template_id = " . $_color_templates[$i] .
" LIMIT " . ($_selected_graph_index % $num_colors) . ",1";
The sequence is not being utilized and the (default) insert order is being used...
Changing line 184 to this fixes the bug:

Code: Select all

" ORDER BY sequence LIMIT " . ($_selected_graph_index % $num_colors) . ",1";
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest