Web Weather > Weather Web Site Help

NWS Alerts errors

<< < (2/3) > >>

mkutche:

--- Quote from: saratogaWX on March 23, 2023, 07:57:41 PM ---It's likely because you've enabled
--- Code: ---$logAlerts     = true;         // true=log alerts    false=don't log alerts
--- End code ---
in nws-alerts-config.php and the current copy of ./alertlog/NWSalertLog20230323.txt contains
--- Code: ---<?php 
 
$daily_log = NULL;

?>

--- End code ---
which is not an array, but NULL and Curly's code doesn't handle that in PHP over 5.6.

Change nws-alerts-config.php to
--- Code: ---$logAlerts     = false;         // true=log alerts    false=don't log alerts

--- End code ---
and the warnings should disappear.

I see logs with data on the 21st and 22nd, with a lot of Hydrologic Alerts, but the 23rd has no alerts.

The default for the template set was to NOT use alert logging, so I'd not adapted the Curly script to handle the $daily_log = NULL; issue.. turning it off is your best course for now.

--- End quote ---

ok that fixed it, just weird I never had this issue in the past. I really like the alert logging I hope you can fix it one day.

saratogaWX:
I think I've fixed the cause of the issues with $daily_log = NULL;

Try the attached nws-alerts.php V1.44

mkutche:

--- Quote from: saratogaWX on March 24, 2023, 02:29:43 PM ---I think I've fixed the cause of the issues with $daily_log = NULL;

Try the attached nws-alerts.php V1.44

--- End quote ---

no longer getting those errors with the attached nws-alerts.php v1.44 you sent. Thanks Ken :)

mkutche:
Sorry to bother you again but now this error popped up on NWS Alerts Log


--- Quote ---Warning: count(): Parameter must be an array or an object that implements Countable in /hermes/walnacweb03/walnacweb03/walnacweb03aa/b1007/moo.cyrptoworldnet/Gosportwx/wxnws-alerts-log.php on line 145

Warning: Invalid argument supplied for foreach() in /hermes/walnacweb03/walnacweb03/walnacweb03aa/b1007/moo.cyrptoworldnet/Gosportwx/wxnws-alerts-log.php on line 150
--- End quote ---

http://gosportwx.com/wxnws-alerts-log.php?logfile=20230323

saratogaWX:
Hmmm...

Try changing wxnws-alert-log.php from
--- Code: ---// count the alerts
$alert_count = count($daily_log);

--- End code ---
to
--- Code: ---// count the alerts
if(!isset($daily_log) or !is_array($daily_log)) {$daily_log = array(); }
$alert_count = count($daily_log);

--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version