Author Topic: Advforecast2.php error.  (Read 1205 times)

0 Members and 1 Guest are viewing this topic.

Offline mkutche

  • Forecaster
  • *****
  • Posts: 1043
    • GosportWx.com
Advforecast2.php error.
« on: July 17, 2022, 12:05:17 PM »
I recently updated advforecast2.php and now i get this error on occasion..

Quote
Notice: Trying to access array offset on value of type null in /hermes/walnacweb03/walnacweb03aa/b1007/moo.cyrptoworldnet/Gosportwx/advforecast2.php on line 556

and

Quote
Notice: Trying to access array offset on value of type null in /hermes/walnacweb03/walnacweb03aa/b1007/moo.cyrptoworldnet/Gosportwx/advforecast2.php on line 556
National Weather Service Forecast for: Gosport
Sorry.. the forecast for Gosport is not available at this time.

NWS server has an error.

View the source of this page for additional information in HTML comments.
Mike K.
Davis Vantage Vue 6250 - CumulusMX (3.21.1-b3205)
Gosport, Indiana
Gosportwx.com twitter.com/GosportINWX
-----------------------------------------------------------

Offline mkutche

  • Forecaster
  • *****
  • Posts: 1043
    • GosportWx.com
Re: Advforecast2.php error.
« Reply #1 on: July 17, 2022, 12:13:49 PM »
I recently updated advforecast2.php and now i get this error on occasion..

Quote
Notice: Trying to access array offset on value of type null in /hermes/walnacweb03/walnacweb03aa/b1007/moo.cyrptoworldnet/Gosportwx/advforecast2.php on line 556

and

Quote
Notice: Trying to access array offset on value of type null in /hermes/walnacweb03/walnacweb03aa/b1007/moo.cyrptoworldnet/Gosportwx/advforecast2.php on line 556
National Weather Service Forecast for: Gosport
Sorry.. the forecast for Gosport is not available at this time.

NWS server has an error.

View the source of this page for additional information in HTML comments.

seems to be working again i was just wondering what causes this error.
Mike K.
Davis Vantage Vue 6250 - CumulusMX (3.21.1-b3205)
Gosport, Indiana
Gosportwx.com twitter.com/GosportINWX
-----------------------------------------------------------

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 949
    • LexMAWeather
Re: Advforecast2.php error.
« Reply #2 on: July 17, 2022, 12:47:07 PM »
I think the code in question is this line:

Code: [Select]
$FCSTJSON = $rawJSON['properties'];      // geoJSON format

If you get an error on the fetch, 'properties' may not be set. I ran into this a while ago and modified it to:

Code: [Select]
if (isset($rawJSON['properties']) )
  $FCSTJSON = $rawJSON['properties'];      // geoJSON format
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community