Skip to content

Commit

Permalink
Fixing #5459 - API Duplicate Graph Template too agressive
Browse files Browse the repository at this point in the history
There is no option to not duplicate Graph Template Data Query association when duplicating a Graph Template
  • Loading branch information
TheWitness committed Aug 20, 2023
1 parent a97ec10 commit bf1cf1e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ Cacti CHANGELOG
-issue#5454: Cacti Orphan Graphs Selector missing column 'orphan' in SQL selector
-issue#5457: Enable 'Re-Index All Device Schedule' causes a lot of reindex processes
-issue#5458: Unable to delete a Data Query when there are no Graphs using it
-issue#5459: There is no option to not duplicate Graph Template Data Query association when duplicating a Graph Template
-feature#5375: Add template for Fortinet firewall and Aruba Instant cluster
-feature#5393: Add template for SNMP printer
-feature#5418: Display device class before package import
Expand Down
4 changes: 2 additions & 2 deletions lib/api_graph.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ function api_get_graphs_from_datasource($local_data_id) {
AND data_template_rrd.local_data_id = ?', array($local_data_id)), 'id', 'name');
}

function api_duplicate_graph($_local_graph_id, $_graph_template_id, $graph_title) {
function api_duplicate_graph($_local_graph_id, $_graph_template_id, $graph_title, $map_to_data_query = true) {
global $struct_graph, $struct_graph_item;

if (!empty($_local_graph_id)) {
Expand Down Expand Up @@ -487,7 +487,7 @@ function api_duplicate_graph($_local_graph_id, $_graph_template_id, $graph_title

if (!empty($_local_graph_id)) {
update_graph_title_cache($local_graph_id);
} else {
} elseif ($map_to_data_query) {
// Graph Template, Check for Data Query Associated Graph Template
$data_query_graphs = db_fetch_assoc_prepared('SELECT *
FROM snmp_query_graph
Expand Down

0 comments on commit bf1cf1e

Please sign in to comment.