Author Topic: wxreports problem under PHP8.2.2 (Resolved)  (Read 950 times)

0 Members and 1 Guest are viewing this topic.

Offline krekel

  • Member
  • *
  • Posts: 14
    • Weerstation Assen
wxreports problem under PHP8.2.2 (Resolved)
« on: February 13, 2023, 09:32:18 AM »
Hi all.
I'm using the wxreports scrip from Murry Connaroe of Wildwood Weather. https://www.weerstation-assen.nl/WD-archief.php
See tab Uren zon.
Now that I have updated the server to PHP 8.2.2 only the sunshinehours page does not work.
Who has the script working under PHP8 and wants to share it?
Or who can help fix the error so that this page works again?

And, I wish I could be a scriptwriter to solve the problems myself but unfortunately I don't have that expertise.....

Thanks.

Brgds,
Oebel
« Last Edit: February 15, 2023, 02:11:18 AM by krekel »

Offline krekel

  • Member
  • *
  • Posts: 14
    • Weerstation Assen
Re: wxreports problem under PHP8.2.2
« Reply #1 on: February 14, 2023, 09:58:12 AM »
Problem is resolved with help from Wim (PWSdashboard)

Line 207, change from
Code: [Select]
$hours_today = (string)( $temp[0] + (round(($temp[1]/60)*10)/10));   // Convert minutes to tenths of hours

    to

Code: [Select]
$hours_today = (string)((float)$temp[0] + (round(($temp[1]/60)*10)/10));   // Convert minutes to tenths of hours
Maybe that is the error blocking the script.

And that was the problem.
Many thanks tot Wim!

Brgds,
Oebel

« Last Edit: February 14, 2023, 10:01:10 AM by krekel »