Cacti / plugin_weathermap

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

Latest dev branch give PHP DEPRECATED Implicit conversion from float to int #140

Closed arno-st closed 5 months ago

arno-st commented 5 months ago

Hello, Cacti 1.2.26 latest dev branche, PHP 8.2.x, weathermap latest dev branch I got this error:

17/01/2024  10:50:16 - 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[1169]:weathermap_run_maps(),  /plugins/weathermap/lib/poller-common.php[442]:WeatherMap->DrawMap(),   /plugins/weathermap/lib/WeatherMap.class.php[3569]:WeatherMapNode->pre_render(),   /plugins/weathermap/lib/WeatherMapNode.class.php[524]:imagecopyresampled(),  CactiErrorHandler())
--
17/01/2024 10:50:16 - ERROR PHP DEPRECATED in  Plugin 'weathermap':  Implicit conversion from float 35.714285714285715 to int loses precision  in file:  /usr/share/cacti/plugins/weathermap/lib/WeatherMapNode.class.php  on  line: 524
17/01/2024 10:50:16 - 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[1169]:weathermap_run_maps(),  /plugins/weathermap/lib/poller-common.php[442]:WeatherMap->DrawMap(),   /plugins/weathermap/lib/WeatherMap.class.php[3569]:WeatherMapNode->pre_render(),   /plugins/weathermap/lib/WeatherMapNode.class.php[521]:imagecreatetruecolor(),  CactiErrorHandler())
17/01/2024 10:50:16 - ERROR PHP DEPRECATED in  Plugin 'weathermap':  Implicit conversion from float 35.714285714285715 to int loses precision  in file:  /usr/share/cacti/plugins/weathermap/lib/WeatherMapNode.class.php  on  line: 521
TheWitness commented 5 months ago

Awesome!

TheWitness commented 5 months ago

Test the updated develop. Thanks!

arno-st commented 5 months ago

Hi, thank for the work, but I still have this error:

30/01/2024  12:31:18 - 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[1169]:weathermap_run_maps(),  /plugins/weathermap/lib/poller-common.php[442]:WeatherMap->DrawMap(),   /plugins/weathermap/lib/WeatherMap.class.php[3588]:WeatherMap->DrawLegend_Classic(),   /plugins/weathermap/lib/WeatherMap.class.php[1792]:Colour->gdallocate(),   /plugins/weathermap/lib/WeatherMap.functions.php[1813]:myimagecolorallocate(),   /plugins/weathermap/lib/WeatherMap.functions.php[363]:imagecolorexact(),  CactiErrorHandler())
--
30/01/2024 12:31:18 - ERROR PHP DEPRECATED in  Plugin 'weathermap':  Implicit conversion from float 7.96875 to int loses precision in file:  /usr/share/cacti/plugins/weathermap/lib/WeatherMap.functions.php  on  line: 363
catan-trfk commented 5 months ago

Same problem.

2024-01-30 13:24:07 - ERROR PHP DEPRECATED in Plugin 'weathermap': Implicit conversion from float 254.99428979746665 to int loses precision in file: /var/www/html/cacti/plugins/weathermap/lib/WeatherMap.functions.php on line: 363

TheWitness commented 5 months ago

That was not previously reported.

TheWitness commented 5 months ago

I just fixed this warning in GitHub.

arno-st commented 5 months ago

Yes it was not reported, sorry

All ok now thanks

Luth1ng commented 3 months ago

Hello @TheWitness, do you know when the 1.2 including this fix will be released ?

TheWitness commented 3 months ago

Thanks for the reminder. I'll be working on Cacti for the next few weeks. Should be able to fix this by then.

TheWitness commented 3 months ago

Sorry guys. I've been on sabbatical. I'm tracing one issue right now with a user. I have to then do a full review of what is outstanding. Depends in part on @HerrDrSt feedback.

HerrDrSt commented 3 months ago

Hallo @TheWitness

I have replied to the thread. I have also sent the files as requested on mail.

Luth1ng commented 2 months ago

Hello @TheWitness, do you have an ETR for the release fixing the issue please ?

TheWitness commented 2 months ago

I'm just working on one issue and confirming the rest. I should make some progress this weekend.

There have been a number of delays on my part including family issues and work schedule being pretty rough. It's the same with the thold plug-in as well.

Luth1ng commented 2 months ago

Hello @TheWitness,

I am still having the error logs despite of upgraded to 1.3 :

30-04-2024 08:46:10 - 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[1169]:weathermap_run_maps(), /plugins/weathermap/lib/poller-common.php[442]:WeatherMap->DrawMap(), /plugins/weathermap/lib/WeatherMap.class.php[3610]:WeatherMap->DrawLegend_Horizontal(), /plugins/weathermap/lib/WeatherMap.class.php[1507]:imageline(), CactiErrorHandler())
30-04-2024 08:46:10 - ERROR PHP DEPRECATED in Plugin 'weathermap': Implicit conversion from float 35.4 to int loses precision in file: /usr/share/cacti/plugins/weathermap/lib/WeatherMap.class.php on line: 1507
30-04-2024 08:46:10 - 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[1169]:weathermap_run_maps(), /plugins/weathermap/lib/poller-common.php[442]:WeatherMap->DrawMap(), /plugins/weathermap/lib/WeatherMap.class.php[3610]:WeatherMap->DrawLegend_Horizontal(), /plugins/weathermap/lib/WeatherMap.class.php[1507]:imageline(), CactiErrorHandler())
30-04-2024 08:46:10 - ERROR PHP DEPRECATED in Plugin 'weathermap': Implicit conversion from float 35.4 to int loses precision in file: /usr/share/cacti/plugins/weathermap/lib/WeatherMap.class.php on line: 1507
30-04-2024 08:46:10 - 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[1169]:weathermap_run_maps(), /plugins/weathermap/lib/poller-common.php[442]:WeatherMap->DrawMap(), /plugins/weathermap/lib/WeatherMap.class.php[3610]:WeatherMap->DrawLegend_Horizontal(), /plugins/weathermap/lib/WeatherMap.class.php[1507]:imageline(), CactiErrorHandler())
30-04-2024 08:46:10 - ERROR PHP DEPRECATED in Plugin 'weathermap': Implicit conversion from float 35.4 to int loses precision in file: /usr/share/cacti/plugins/weathermap/lib/WeatherMap.class.php on line: 1507
30-04-2024 08:46:10 - 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[1169]:weathermap_run_maps(), /plugins/weathermap/lib/poller-common.php[442]:WeatherMap->DrawMap(), /plugins/weathermap/lib/WeatherMap.class.php[3610]:WeatherMap->DrawLegend_Horizontal(), /plugins/weathermap/lib/WeatherMap.class.php[1507]:imageline(), CactiErrorHandler())
30-04-2024 08:46:10 - ERROR PHP DEPRECATED in Plugin 'weathermap': Implicit conversion from float 35.4 to int loses precision in file: /usr/share/cacti/plugins/weathermap/lib/WeatherMap.class.php on line: 1507
30-04-2024 08:46:10 - 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[1169]:weathermap_run_maps(), /plugins/weathermap/lib/poller-common.php[442]:WeatherMap->DrawMap(), /plugins/weathermap/lib/WeatherMap.class.php[3610]:WeatherMap->DrawLegend_Horizontal(), /plugins/weathermap/lib/WeatherMap.class.php[1507]:imageline(), CactiErrorHandler())
30-04-2024 08:46:10 - ERROR PHP DEPRECATED in Plugin 'weathermap': Implicit conversion from float 35.4 to int loses precision in file: /usr/share/cacti/plugins/weathermap/lib/WeatherMap.class.php on line: 1507 

Is that an intended behavior ?

TheWitness commented 2 months ago

Nope, just catching more of these PHP deprecation issues. Fixing it shortly.

TheWitness commented 2 months ago

Update to the latest develop and share more if you find them. Open a new ticket though.