can't associate new Graph Templates to data query

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Moderators, Developers

Post Reply
Author
Message
DM_Perm
Posts: 3
Joined: Mon Jan 17, 2011 6:13 am

can't associate new Graph Templates to data query

#1 Post by DM_Perm » Thu Jan 24, 2019 3:54 am

Hello!
cacti 1.2.1 Debian 9 php7.0.33
I have working data query, and I want to add new graph template to it. But when I select graph template and press 'create' button - nothing happened, and I've got message in cacti.log:
2019/01/24 09:18:49 - ERROR PHP NOTICE: Undefined variable: errors in file: /var/www/cacti10/data_queries.php on line: 172
2019/01/24 09:18:49 - CMDPHP PHP ERROR NOTICE Backtrace: (/data_queries.php[39]:form_save(), /data_queries.php[172]:CactiErrorHandler())
Any ideas? How to debug this priblem?

PS it's a fresh installation of cacti.

netniV
Cacti Guru User
Posts: 2670
Joined: Sun Aug 27, 2017 12:05 am

Re: can't associate new Graph Templates to data query

#2 Post by netniV » Thu Jan 24, 2019 2:20 pm

Add the following at line 168:

Code: Select all

$errors = false;

Code: Select all

diff --git a/data_queries.php b/data_queries.php
index b1d1740b..bfdbeb56 100644
--- a/data_queries.php
+++ b/data_queries.php
@@ -165,6 +165,7 @@ function form_save() {
                $header = '';
 
                if (!is_error_message()) {
+                       $errors = false;
                        if ($save['id'] > 0) {
                                $errors = api_data_query_errors($save['id'], $_POST);
                        }
It would be good if you can record this issue on GitHub


Post Reply