6.0.0-beta1
7/7/25

[#7847] TAF data issue in metar.php
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

History
11/04/2009 06:32:41 AM Michael Rubinsky Comment #17 Reply to this comment
The patch to Services_Weather has been officially applied upstream.

https://pear.php.net/bugs/bug.php?id=14732&edit=2
03/26/2009 02:19:49 PM Michael Rubinsky Comment #16 Reply to this comment
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).
...and just to be clear, I'm talking about the 
Services/Weather/Metar.php file from PEAR, in your include_path.


03/26/2009 02:17:52 PM Michael Rubinsky Comment #15 Reply to this comment
I'm not 100% sure about where the prob should be, and also I'm not
sure that the line break means anything
The line break absolutely means something.  Its part of the defined 
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).


03/26/2009 11:12:26 AM horde (at) heskia (dot) net Comment #14 Reply to this comment
I'm not 100% sure about where the prob should be, and also I'm not 
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
03/25/2009 07:57:25 PM Michael Rubinsky Comment #13 Reply to this comment
The TAF data being sent for that airport does not conform to the ICAO 
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.
03/25/2009 06:52:58 PM horde (at) heskia (dot) net Comment #12 Reply to this comment
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?
Hi Michael,



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.
03/18/2009 07:52:48 PM Michael Rubinsky Comment #11 Reply to this comment
Though actually, thinking about it some more, I don't see how you 
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?
03/18/2009 07:31:20 PM Michael Rubinsky Comment #10 Reply to this comment
Patch to fix this issue has been reported to pear.



https://pear.php.net/bugs/bug.php?id=14732


03/18/2009 07:01:02 PM Michael Rubinsky Comment #9 Reply to this comment
Yes. It looks like another patch that was applied to fix another 
problem is conflicting with changes made by our patch.



I'll look into it and report it to the maintainer.
03/18/2009 05:32:03 PM horde (at) heskia (dot) net Comment #8 Reply to this comment
For anyone who finds the bug looking for a solution, this was fixed
in the 1.4.4 version of Services_Weather
Hi Michael, I have updated PEAR Services_Weather module to 1.4.4 and I 
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 ?
03/13/2009 10:56:38 PM Michael Rubinsky Comment #7 Reply to this comment
For anyone who finds the bug looking for a solution, this was fixed in 
the 1.4.4 version of Services_Weather
01/16/2009 05:00:38 PM Michael Rubinsky Comment #5 Reply to this comment
I'm going to revert the changes to this block since this is really a 
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.
01/15/2009 12:58:53 PM horde (at) heskia (dot) net Comment #4 Reply to this comment
Yes you're right that is the new TAF format designed by the ICAO.

I have uploaded the new version of metar.php in my horde portal and it 
looks better !

Thanks for the update.


01/14/2009 06:13:11 PM Michael Rubinsky Comment #2
State ⇒ Resolved
Assigned to Michael Rubinsky
Reply to this comment
It's not quite that simple. The TAF format was changed to deal with 
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
01/14/2009 05:19:39 PM horde (at) heskia (dot) net Comment #1
Priority ⇒ 1. Low
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Summary ⇒ TAF data issue in metar.php
Type ⇒ Bug
Queue ⇒ Horde Base
Reply to this comment
Hi,



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 ?

Saved Queries