Skip to content

Commit

Permalink
Additional fixes to #3553
Browse files Browse the repository at this point in the history
undefined error when directly visit a none-exist graph
  • Loading branch information
TheWitness committed May 21, 2020
1 parent dc35a79 commit 4301092
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion aggregate_graphs.php
Original file line number Diff line number Diff line change
Expand Up @@ -660,12 +660,23 @@ function graph_edit() {
'items' => __('Items'),
'preview' => __('Preview')
);
} else {
} elseif (cacti_sizeof($graphs)) {
$template = array();
$aggregate_tabs = array(
'details' => __('Details'),
'preview' => __('Preview')
);
} else {
raise_message('missing_aggregate', __('Aggregate Graphs Accessed does not Exist'), MESSAGE_LEVEL_ERROR);

if (isset($_SERVER['HTTP_REFERER'])) {
$referer = sanitize_uri($_SERVER['HTTP_REFERER']);
header('Location: ' . $referer);
} else {
header('Location: aggregate_graphs.php');
}

exit;
}

/* ================= input validation and session storage ================= */
Expand Down Expand Up @@ -812,6 +823,7 @@ function graph_edit() {
html_end_box(true, true);

if (isset($template)) {

draw_aggregate_graph_items_list(0, $template['graph_template_id'], $aginfo);
}

Expand Down

0 comments on commit 4301092

Please sign in to comment.