(SOLVED, but not as it should be) Raportit: Uncaught Error: Call to undefined function get_graph_permissions_sql()

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
stefanbrudny
Cacti User
Posts: 130
Joined: Thu Jan 19, 2012 11:52 am

(SOLVED, but not as it should be) Raportit: Uncaught Error: Call to undefined function get_graph_permissions_sql()

Post by stefanbrudny »

Hi there,
I tried completing this howto again: viewtopic.php?t=31307

I seem to hit an error preventing adding Data Items (Add Data Items) to a newly created report. I think the plugin doesn't work at all in Cacti 1.2.21, as I have rather fresh installation and encountering multiple issues. Just in case i cloned newest version of reportit.

Main issue (page 12, almost at the very end;-))

Code: Select all

2022-06-09 21:16:49 - CMDPHP ERRORS DETECTED - DISABLING PLUGIN 'reportit'
2022-06-09 21:16:49 - CMDPHP PHP ERROR Backtrace: (CactiShutdownHandler())
2022-06-09 21:16:49 - ERROR PHP ERROR in Plugin 'reportit': Uncaught Error: Call to undefined function get_graph_permissions_sql() in /var/www/html/plugins/reportit/items.php:175 Stack trace: #0 /var/www/html/plugins/reportit/items.php(51): standard() #1 {main} thrown in file: /var/www/html/plugins/reportit/items.php on line: 175 
Second issue is I can save the report, but cannot edit it anymore, as upon subsequent error I get:

Code: Select all

[Thu Jun 09 21:18:52.717907 2022] [php7:notice] [pid 575983] [client 192.168.1.23:40576] PHP Notice:  Undefined index: ? in /var/www/html/lib/functions.php on line 3651, referer: https://192.168.1.34/plugins/reportit/reports.php?action=report_edit&id=1
[Thu Jun 09 21:18:52.718234 2022] [php7:notice] [pid 575983] [client 192.168.1.23:40576] PHP Notice:  Trying to access array offset on value of type null in /var/www/html/lib/functions.php on line 3651, referer: https://192.168.1.34/plugins/reportit/reports.php?action=report_edit&id=1
[Thu Jun 09 21:18:52.719149 2022] [php7:notice] [pid 575983] [client 192.168.1.23:40576] PHP Notice:  Undefined index: ? in /var/www/html/lib/functions.php on line 3653, referer: https://192.168.1.34/plugins/reportit/reports.php?action=report_edit&id=1
[Thu Jun 09 21:18:52.719485 2022] [php7:notice] [pid 575983] [client 192.168.1.23:40576] PHP Notice:  Trying to access array offset on value of type null in /var/www/html/lib/functions.php on line 3653, referer: https://192.168.1.34/plugins/reportit/reports.php?action=report_edit&id=1
[Thu Jun 09 21:18:52.755483 2022] [php7:notice] [pid 575983] [client 192.168.1.23:40576] PHP Notice:  Undefined index: ? in /var/www/html/lib/functions.php on line 3651, referer: https://192.168.1.34/plugins/reportit/reports.php?action=report_edit&id=1
[Thu Jun 09 21:18:52.755950 2022] [php7:notice] [pid 575983] [client 192.168.1.23:40576] PHP Notice:  Trying to access array offset on value of type null in /var/www/html/lib/functions.php on line 3651, referer: https://192.168.1.34/plugins/reportit/reports.php?action=report_edit&id=1
[Thu Jun 09 21:18:52.757383 2022] [php7:notice] [pid 575983] [client 192.168.1.23:40576] PHP Notice:  Undefined index: ? in /var/www/html/lib/functions.php on line 3653, referer: https://192.168.1.34/plugins/reportit/reports.php?action=report_edit&id=1
[Thu Jun 09 21:18:52.757858 2022] [php7:notice] [pid 575983] [client 192.168.1.23:40576] PHP Notice:  Trying to access array offset on value of type null in /var/www/html/lib/functions.php on line 3653, referer: https://192.168.1.34/plugins/reportit/reports.php?action=report_edit&id=1

stefanbrudny
Cacti User
Posts: 130
Joined: Thu Jan 19, 2012 11:52 am

Re: (SOLVED, but not as it should be) Raportit: Uncaught Error: Call to undefined function get_graph_permissions_sql()

Post by stefanbrudny »

Ugly solution to overcome this fast is to edit plugins/reportit/items.php

and change the line 175 from:

Code: Select all

        $sql_where = get_graph_permissions_sql($current_owner['policy_graphs'], $current_owner['policy_hosts'], $current_owner['policy_graph_templates']);
to:

Code: Select all

        //$sql_where = get_graph_permissions_sql($current_owner['policy_graphs'], $current_owner['policy_hosts'], $current_owner['policy_graph_templates']);
Bear in mind this will result in skipping graph permission checks (or not?)
Last edited by stefanbrudny on Thu Jun 09, 2022 2:42 pm, edited 1 time in total.
User avatar
TheWitness
Developer
Posts: 16897
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: (SOLVED, but not as it should be) Raportit: Uncaught Error: Call to undefined function get_graph_permissions_sql()

Post by TheWitness »

Oh, goodness. Andi (browniebrawn) needs to remove that function call. We de-contented it from Cacti a few releases ago. That logic is not good.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
TheWitness
Developer
Posts: 16897
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: (SOLVED, but not as it should be) Raportit: Uncaught Error: Call to undefined function get_graph_permissions_sql()

Post by TheWitness »

Stefan,

If you could log that in GitHub in the reportit forum Andi will take care of it.

Larry
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
TheWitness
Developer
Posts: 16897
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: (SOLVED, but not as it should be) Raportit: Uncaught Error: Call to undefined function get_graph_permissions_sql()

Post by TheWitness »

Thanks!
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests