Cacti: [1.2.0] Get error message when adding new traffic graph

Created on 13 Sep 2018  路  5Comments  路  Source: Cacti/cacti

When I adding new interface traffic graph for some device, it will show this error message in cacti log:

2018/09/13 11:06:33 - CMDPHP PHP ERROR WARNING Backtrace: (/graphs_new.php[38]:form_save(), /graphs_new.php[124]:html_graph_new_graphs(), /lib/html_graph.php[509]:host_new_graphs_save(), /graphs_new.php[218]:create_save_graph(), /lib/template.php[1456]:create_complete_graph_from_template(), /lib/template.php[1124]:create_graph_has_custom_data_properties(), /lib/template.php[1378]:sizeof(), CactiErrorHandler())
2018/09/13 11:06:33 - ERROR PHP WARNING: sizeof(): Parameter must be an array or an object that implements Countable in file: /opt/cacti-web/lib/template.php on line: 1378

But new graph seems works fine.

beta bug

Most helpful comment

This is fixed now. It hurts, but it's fixed.

All 5 comments

This is a PHP 7.2 bug, will take a look shortly. Normally it means that we are trying to run the count() or sizeof() functions against a variable that does not contain an array or object.

Is this issue related to Warn when counting non-countable types ?

Yes. That's the exact issue.

This is fixed now. It hurts, but it's fixed.

Yeah, I don't like it. We will have plugins that need a similar thing and if we use this function in core, it'll bump the minimum requirement right up

Was this page helpful?
0 / 5 - 0 ratings