Cacti / plugin_reportit

ReportIt Plugin for Cacti
GNU General Public License v2.0
7 stars 8 forks source link

Backported mailer() function uses function only defined in Cacti 1.2+ #71

Closed ikorzha closed 5 years ago

ikorzha commented 5 years ago

netniV, thank you for the latest commit it did resolved malformed .csv export however introduced new issue with php errors and plugin disabled. Please see below: From Cacti log: image

From Cli log: [root@CACTIONE ~]# php /var/www/html/plugins/reportit/runtime.php -d -v PHP Notice: A non well formed numeric value encountered in /var/www/html/plugins/reportit/include/vendor/pclzip/pclzip.lib.php on line 1846 PHP Fatal error: Uncaught Error: Call to undefined function cacti_sizeof() in /var/www/html/plugins/reportit/lib/funct_mailer.php:212 Stack trace:

0 /var/www/html/plugins/reportit/lib/funct_shared.php(1286): v1_2_0_mailer(Array, Array, Array, Array, Array, 'Scheduled repor...', 'This is a sched...', '', Array, '', true)

1 /var/www/html/plugins/reportit/runtime.php(734): send_scheduled_email('1')

2 /var/www/html/plugins/reportit/runtime.php(164): runtime('1')

3 /var/www/html/plugins/reportit/runtime.php(100): run('daily')

4 {main}

thrown in /var/www/html/plugins/reportit/lib/funct_mailer.php on line 212 You have mail in /var/spool/mail/root [root@CACTIONE ~]#

netniV commented 5 years ago

ah, this is because I back ported the 1.2 mailer, since I prefer it as I rewrote it heh. The problem is that there is a PHP 7.2 fix in 1.2 called cacti_sizeof() and cacti_count() which handles the 7.2 breaking change related to sizeof()/count() requiring an object of type ICountable

I'll modify the back port to have a proper resolution and that should then just work.

netniV commented 5 years ago

This has now been committed to the development code.