Cacti / plugin_weathermap

Weathermap for Cacti 1.x
MIT License
77 stars 26 forks source link

PHP Deprecation in Weathermap.class.php, implicit conversion from float to int #127

Closed chrisrogerson closed 7 months ago

chrisrogerson commented 7 months ago

CMDPHP PHP ERROR Backtrace: (/poller.php[917]:api_plugin_hook(), /lib/plugins.php[89]:api_plugin_run_plugin_hook(), /lib/plugins.php[231]:weathermap_poller_bottom(), /plugins/weathermap/setup.php[1142]:weathermap_run_maps(), /plugins/weathermap/lib/poller-common.php[442]:WeatherMap->DrawMap(), /plugins/weathermap/lib/WeatherMap.class.php[3596]:WeatherMap->DrawLegend_Vertical(), /plugins/weathermap/lib/WeatherMap.class.php[1617]:imageline(), CactiErrorHandler()) ERROR PHP DEPRECATED in Plugin 'weathermap': Implicit conversion from float 429.6 to int loses precision in file: /usr/share/cacti/site/plugins/weathermap/lib/WeatherMap.class.php on line: 1617

TheWitness commented 7 months ago

Thanks for reporting. Got three new weathermap issues, so I'll likely be working on a patch.

TheWitness commented 7 months ago

Please grab the latest develop branch and let us know if this issue is resolved.

chrisrogerson commented 7 months ago

Looks like you added a close parentheses at the end of line 1611 that breaks the plugin entirely.

2023-11-15 10:38:39 - CMDPHP ERRORS DETECTED - DISABLING PLUGIN 'weathermap'

2023-11-15 10:38:39 - CMDPHP PHP ERROR Backtrace: (CactiShutdownHandler()) 2023-11-15 10:38:39 - ERROR PHP PARSE in Plugin 'weathermap': Unclosed '{' on line 1610 does not match ')' in file: /usr/share/cacti/site/plugins/weathermap/lib/WeatherMap.class.php on line: 1611

Removing the parentheses corrects this, but still leaves the implicit conversion error.

TheWitness commented 7 months ago

Whoops ;). More coffee in my mornings is needed.