Summary | TAF data issue in metar.php |
Queue | Horde Base |
Queue Version | 3.3.2 |
Type | Bug |
State | Resolved |
Priority | 1. Low |
Owners | mrubinsk (at) horde (dot) org |
Requester | horde (at) heskia (dot) net |
Created | 01/14/2009 (6018 days ago) |
Due | |
Updated | 11/04/2009 (5724 days ago) |
Assigned | |
Resolved | 01/14/2009 (6018 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
https://pear.php.net/bugs/bug.php?id=14732&edit=2
(Perhaps introduce a syntax error in the file so you can see that the
file is indeed the one being used).
Services/Weather/Metar.php file from PEAR, in your include_path.
sure that the line break means anything
format for transmitting the "Meteorological Codes" data. The weather
service you are using might not display the line breaks to you in the
format you are viewing it, but the raw weather data has them. It
delineates groupings, and is required. See
http://adds.aviationweather.gov/metars/index.php?submit=1&station_ids=lfly&chk_tafs=on for the formatting. You could also poke around Metar.php in Services_Weather and see the full raw data string returned from the weather service (including the TAF and produced times
etc...)
Anyway, I'm unable to reproduce your error even with the data from
LFLY and it makes absolutely no sense to me why you would be seeing
that exact same error with the new version of Metar.php. Even without
the fixes I just submitted to PEAR, the error would be different only
a warning is produced while the forecast data displays correctly.
Please verify that you are, indeed, *using* the new Metar.php file.
(Perhaps introduce a syntax error in the file so you can see that the
file is indeed the one being used).
sure that the line break means anything (I use not to have line break
in the weather report I got from other weather forecast system) .
Anyway, today there's no prob in the TAF and now the error is at line
349 (and not 416):
Warning: Invalid argument supplied for foreach() in
/home/ovh/www/horde/lib/Block/metar.php on line 349
The TAF of today is:
TAF : LFLY 260524Z 2606/2706 34005KT 9999 SCT025 BKN035 BECMG2609/2611
SCT030 SCT050 BECMG 2615/2617 18010KT SCT035 BKN050 TEMPO2621/2706
6000 RA BKN020 BKN035
standards from what I can see:
TAF LFLY 251700Z 2518/2618 29010KT 9999 SCT030 BKN050
TEMPO 2518/2522 6000 RA FEW015 BKN030
BECMG 2522/2601 VRB02KT SCT015 BKN035 PROB40
TEMPO 2602/2609 6000 BKN013
The 'PROB40' group is supposed to be followed by a time group to
define the period that the probability applies. In the TAF I just
pulled, that is not the case - it's followed immediately by a line
break and another TEMPO grouping. This breaks the time parsing code.
You can try to report this issue to the Services_Weather maintainer if
you like, but it is ultimately up to him to decide if a fix will be
provided for a non-standard data format.
metar block? If so, and after applying the latest patch to
Services_Weather, you still get that error, can you provide a test
case, or at least a TAF string that is causing this error for you?
I have double-check the PEAR Service_Weather module: it is really
version 1.4.4
for the metar block in Horde, I have re-downloaded Horde v3.3.3 from
horde ftp site (ftp://ftp.horde.org/pub/horde/horde-3.3.3.tar.gz)
whioch is stated as:
* $Horde: horde/lib/Block/metar.php,v 1.22.10.11 2009/01/16 17:05:59
mrubinsk Exp $
and cleared the cache content (both in the MySQL database and within
my browser) and I still got the error:
Warning: Invalid argument supplied for foreach() in
/home/ovh/www/horde/lib/Block/metar.php on line 416
The TAF data I have setup is :
Country: France
Location: Lyon / Bron
Unit: Metrics
Wind speed in knots: checked
Display forecast (TAF): checked
I have then tried version in CVS repository :
http://cvs.horde.org/co.php/horde/lib/Block/metar.php?r=1.38&p=1
This version is stated :
$Horde: horde/lib/Block/metar.php,v 1.35 2008/08/28 19:34:58 mrubinsk Exp $
and same error:
Warning: Invalid argument supplied for foreach() in
/home/ovh/www/horde/lib/Block/metar.php on line 416
Do you have any explanation ?
Thanks,
Antoine.
would be getting that *same* error as before. With this (new) issue
you should be getting something like an Array to String conversion
error in Metar.php.
Are you sure the newest version of both Services_Weather and the metar
block? If so, and after applying the latest patch to Services_Weather,
you still get that error, can you provide a test case, or at least a
TAF string that is causing this error for you?
https://pear.php.net/bugs/bug.php?id=14732
problem is conflicting with changes made by our patch.
I'll look into it and report it to the maintainer.
in the 1.4.4 version of Services_Weather
still have the error message:
Warning: Invalid argument supplied for foreach() in
/home/ovh/www/horde/lib/Block/metar.php on line 349
when I select "Show TAF" options in Horde.
Do you know why ?
the 1.4.4 version of Services_Weather
http://pear.php.net/bugs/patch-display.php?bug=15637&patch=fix_for_30_hour_taf_format&revision=latest
Services_Weather issue. I submitted a patch to PEAR that fixes the
issue, you can wait for when (if) it's updated or you can patch it
manually.
I have uploaded the new version of metar.php in my horde portal and it
looks better !
Thanks for the update.
State ⇒ Resolved
Assigned to Michael Rubinsky
the fact that high impact airports now require a 30 hour 'valid' time.
The end result is that the portion of the TAF data representing valid
times now includes a 4 extra digits (representing the day of month for
both the start and end times).
I've made the change to the metar block to take care of the missing
'time' index, so now at least the forecast itself will print - but
until Services_Weather is updated to reflect the new TAF format, the
forecast's valid times will remain blank.
See http://aviationweather.gov/notice/taf30.php for information
regarding the TAF format and
http://lists.horde.org/archives/cvs/Week-of-Mon-20090112/086173.html
for a patch against the lib/Block/metar.php
Priority ⇒ 1. Low
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Summary ⇒ TAF data issue in metar.php
Type ⇒ Bug
Queue ⇒ Horde Base
Since a couple of weeks (months) the TAF data provided by the
Service_Weather, is no more an array indexed by hours as the OACI has
decide to produce only one TAF per airport.
So the "foreach" loop starting at line n°345 is no more needed as the
$taf['time'] does not exist anymore.
Could you fix this in the file horde/lib/Block/metar.php ?