Author Topic: Saratoga Template Error  (Read 417 times)

0 Members and 1 Guest are viewing this topic.

Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1597
    • Texas Weather
Saratoga Template Error
« on: March 17, 2024, 01:42:04 PM »
Hello Team,

Today I came to find an error:

 Fatal error: Uncaught TypeError: Unsupported operand types: string - string in /home/ferfue2/txweather.org/MB-defs.php:221 Stack trace: #0 /home/ferfue2/txweather.org/MBtags.php(648): include_once() #1 /home/ferfue2/txweather.org/top.php(81): include_once('/home/ferfue2/t...') #2 /home/ferfue2/txweather.org/index.php(39): include('/home/ferfue2/t...') #3 {main} thrown in /home/ferfue2/txweather.org/MB-defs.php on line 221

Any ideas?

TIA!

----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 951
    • LexMAWeather
Re: Saratoga Template Error
« Reply #1 on: March 17, 2024, 02:10:41 PM »
The line in question (221) is:

Code: [Select]
  $rain5minuteago = sprintf($rainDP,$WX['rain0total-val5']-$WX['rain0total-ydmin']); // should be dmax!

Looking at your MBtags via https://www.txweather.org/MBtags.php?sce=view

Code: [Select]
rain0total-val5|8.59|// rain value 5 minutes ago:|:

rain0total-ydmin|--|// rain min of yesterday:|:

So I think it's barfing because the "ydmin" value isn't numeric. I'd have to look into the docs to remember what all these values are supposed to mean in relation to rain total but it's probably something someone else knows off the top of their head. The comment on the line of code also makes it a bit curious...
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1597
    • Texas Weather
Re: Saratoga Template Error
« Reply #2 on: March 17, 2024, 08:54:10 PM »
Thanks for your reply, the odd thing is that, this just started happening. It's been running fine for many years.

----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Saratoga Template Error
« Reply #3 on: March 17, 2024, 09:16:30 PM »
It's still the data being produced by meteobridge that is missing.. You can avoid the issue by changing MB-defs.php
Quote
if ( MB_isdata('th0temp-val5') ) { // only set if the variable has valid data
to
Quote
if ($WX['rain0total-ydmin'] == '--') {$WX['rain0total-ydmin'] = 0.0;}
if ( MB_isdata('th0temp-val5') ) { // only set if the variable has valid data
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1597
    • Texas Weather
Re: Saratoga Template Error
« Reply #4 on: March 17, 2024, 11:19:44 PM »
@Ken, Thanks for your reply. It is still happening. I am baffled as this was not happening before :/


----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Saratoga Template Error
« Reply #5 on: March 17, 2024, 11:36:03 PM »
The update I suggested is not in the current MB-defs.php on your website.. upload it again.

You put it here
Quote
if ($WX['rain0total-ydmin'] == '--') {$WX['rain0total-ydmin'] = 0.0;}
if ( MB_isdata('th0temp-val10') ) { // only set if the variable has valid data
and it needs to be
Quote
if ($WX['rain0total-ydmin'] == '--') {$WX['rain0total-ydmin'] = 0.0;}
if ( MB_isdata('th0temp-val5') ) { // only set if the variable has valid data
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1597
    • Texas Weather
Re: Saratoga Template Error
« Reply #6 on: March 18, 2024, 12:09:26 AM »
Thanks Ken, Yes, my mistake. It brought me online but I have a bunch of deprecated messages.
https://www.txweather.org/

My server is running PHP 8.2 could this be part of the problem?

TIA!

----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 951
    • LexMAWeather
Re: Saratoga Template Error
« Reply #7 on: March 18, 2024, 07:58:44 AM »
Run:

  https://www.txweather.org/check-fetch-times.php?show=versions

and update the indicated files. Then you should have no PHP 8 issues.
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline txweather.org

  • Forecaster
  • *****
  • Posts: 1597
    • Texas Weather
Re: Saratoga Template Error
« Reply #8 on: March 18, 2024, 08:51:14 AM »
Thanks for all the help, still a bit shocked that this had been working, and suddenly BOOM.... nothing works lol.


----
Davis Vantage Pro2 Plus +FARS|Meteobridge Nano SD|Meteohub|Meteobridge MR-3020|WU KTXSPRIN75/PWS JRARGWX75/CWOP EW2972/WBB TXWDVUE75/Blitzortung ID: 1142|AWEKAS: 12095
Donations are welcome: https://paypal.me/ffuentesb

 

anything