6.0.0-beta1
7/4/25

[#10804] some issues with the new weather block
Summary some issues with the new weather block
Queue Horde Framework Packages
Queue Version Git master
Type Bug
State Resolved
Priority 1. Low
Owners mrubinsk (at) horde (dot) org
Requester michael (at) bigmichi1 (dot) de
Created 11/27/2011 (4968 days ago)
Due
Updated 11/30/2011 (4965 days ago)
Assigned 11/29/2011 (4966 days ago)
Resolved 11/30/2011 (4965 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
11/30/2011 10:10:30 AM Jan Schneider State ⇒ Resolved
 
11/30/2011 07:10:33 AM michael (at) bigmichi1 (dot) de Comment #19 Reply to this comment
everything is good now, my mistake was that i thought that the block 
also comes from the Horde_Service_Weather package so i didn't update 
the horde package
11/29/2011 10:58:16 PM Michael Rubinsky Comment #18
State ⇒ Feedback
Reply to this comment
tried the latest from git (some seconds ago), and still have the 
problem with the units.
What location are you using and what other blocks are you displaying? 
I can't reproduce this with *any* driver, whereas before this change, 
I could.
i added a Horde::debug($this->_weather) in __get
__get() in *which* file?

  > and that units is
everytime 1 (STANDARD) also after changing the block configuration. 
i've looked over the code but didn't find the place where the units 
from configuration of the block is set to the driver.
From horde/lib/Block/Weather.php, line 102:

         // Set the requested units.
         $weather->units = $this->_params['units'];

11/29/2011 04:50:50 PM Jan Schneider Comment #17 Reply to this comment
tried the latest from git (some seconds ago), and still have the 
problem with the units.
Works fine for me with the Google driver now.
11/29/2011 08:49:15 AM Jan Schneider Comment #16 Reply to this comment
correct units.  Also, getForecast() doesn't allow you to pass the 
units...not sure where you see this at?
Yeah, I mixed up Horde_Service_Weather::FORECAST_TYPE_STANDARD with 
Horde_Service_Weather::FORECAST_UNIT_STANDARD.
11/29/2011 08:29:47 AM michael (at) bigmichi1 (dot) de Comment #15 Reply to this comment
tried the latest from git (some seconds ago), and still have the 
problem with the units.
i added a Horde::debug($this->_weather) in __get and that units is 
everytime 1 (STANDARD) also after changing the block configuration. 
i've looked over the code but didn't find the place where the units 
from configuration of the block is set to the driver. tried also 
another provider, but same result
11/29/2011 05:02:47 AM Michael Rubinsky Comment #14
State ⇒ Resolved
Reply to this comment
Turns out I was using two different locations when testing, so I 
wasn't seeing the behavior. This should be fixed now.
11/29/2011 05:00:22 AM Git Commit Comment #13 Reply to this comment
Changes have been made in Git for this ticket:

Don't allow changing units on weather data objects after the request.
This can lead to, among other things, incorrect units being displayed
due to a chicken-egg problem in some cases. See Bug: 10804

  11 files changed, 24 insertions(+), 47 deletions(-)
http://git.horde.org/horde-git/-/commit/5022988bee6c675827bdc655494280979c437151
11/29/2011 03:55:24 AM Michael Rubinsky Comment #12 Reply to this comment
The missing icon should be fixed now. Still can't reproduce the units issue.
11/29/2011 03:52:54 AM Git Commit Comment #11 Reply to this comment
Changes have been made in Git for this ticket:

Fix returning icon for current condition for Wwo driver.
Bug: 10804

  1 files changed, 1 insertions(+), 1 deletions(-)
http://git.horde.org/horde-git/-/commit/8ddfca1ede8a7af90fcd9162059e3323b1a15fbc
11/29/2011 03:41:27 AM Git Commit Comment #10 Reply to this comment
Changes have been made in Git for this ticket:

Revert "(Unsuccessful) attempt to fix chicken-and-egg problem from 
ticket #10804."
This reverts commit 3a348cf79f424b01e1fad982c7ec44552c5328a8.

See comments on Bug: 10804

  1 files changed, 11 insertions(+), 5 deletions(-)
http://git.horde.org/horde-git/-/commit/f3befc3a83fa9078687b2cd66bda4593fbfbec13
11/29/2011 03:34:04 AM Michael Rubinsky Comment #9 Reply to this comment
This is exactly why the timeobjects driver sets the units after 
getting the weather driver from the injector. The units *are* 
determined on demand. When we request a value that can returned in 
different units from either the current or period objects, the units 
are checked and the appropriate units are returned.

I'm reverting the changes because $_driver is actually never set in 
the timeobjects driver anyway, and these changes break setting the 
correct units.  Also, getForecast() doesn't allow you to pass the 
units...not sure where you see this at?

I made changes not too long ago that deal with Google returning 
whatever units it seems fit. I cannot reproduce this locally, using 
the calendar block and the weather block, with the Google driver or 
the Wwo driver (which is what the OP is using). I've tried using 
Germal locale, with both European and US locations.
11/28/2011 11:11:28 AM Jan Schneider Comment #8 Reply to this comment
The problem is that the weather object is a singleton, and at least 
the google driver fetches all information at one.
This is a problem if you have a calendar block including weather 
information from timeobjects before the weather block. The timeobjects 
driver is trying to guess the location, and set the requested unit 
based on the current location. But to find a valid location, it 
requests data from Google, instantiating the singleton weather object, 
getting the weather data together with the location data, and no 
longer requesting the (now cached) weather data when this is needed. 
So it doesn't help resetting the unit property after instantiating the 
weather object.
The solution could be to do the unit conversions on-demand, i.e. only 
when actually calling getCurrentConditions() etc. getForecast() even 
allows to pass the units (getCurrentConditions() doesn't), but it's 
not used.
11/28/2011 11:06:38 AM Git Commit Comment #7 Reply to this comment
Changes have been made in Git for this ticket:

(Unsuccessful) attempt to fix chicken-and-egg problem from ticket #10804.

  1 files changed, 5 insertions(+), 11 deletions(-)
http://git.horde.org/horde-git/-/commit/3a348cf79f424b01e1fad982c7ec44552c5328a8
11/28/2011 08:30:03 AM michael (at) bigmichi1 (dot) de Comment #6
New Attachment: new_block.JPG Download
Reply to this comment
translation issues are gone now after install the latest from git.
only two points:
1. missing picture
2. units are not converted
11/27/2011 11:26:53 PM Michael Rubinsky Comment #5
State ⇒ Feedback
Reply to this comment
We still need to provide the full list of strings returned by 
WorldWeatherOnline,  but we also were not passing the condition text 
through the translate method. That has been fixed, and the list of 
strings should be added before the package is released as stable 
though of course, they will still need to be translated...

There *was* an issue with displaying the wrong units, but that was 
already fixed in Git a few days ago. I cannot reproduce this any 
longer. Are you sure you are running the latest Git code?

I can't speak to the problem with the translation file being 
displayed...that's more Jan's area of expertise :)

11/27/2011 11:22:28 PM Git Commit Comment #4 Reply to this comment
Changes have been made in Git for this ticket:

Run conditions text through Horde_Service_Weather_Translation::t
Still need to add the full list of strings returned from Wwo...
Partially fixes Bug: 10804

  2 files changed, 2 insertions(+), 2 deletions(-)
http://git.horde.org/horde-git/-/commit/52e1382a845ec118b6d8c769d9548959d95a3b85
11/27/2011 06:33:20 PM michael (at) bigmichi1 (dot) de Comment #3 Reply to this comment
webserver has been restarted, didn't fix the 1 and 3 issue, also 
rebooting the entire server didn't fix it. clearing browser cache 
didn't help eighter
11/27/2011 04:26:54 PM Jan Schneider State ⇒ Assigned
Assigned to Michael Rubinsky
 
11/27/2011 04:26:12 PM Jan Schneider Comment #2 Reply to this comment
first one is that there is sometimes the entire translation file 
displayed, from my simple point of view, have a look at the first 
screenshot.
Restart your web server.
the second one is that temperature is still in F, but i configured 
metrics in block configuration see second screenshot
Confirmed.
the thirsd on is that some things are not translated, like sunny as 
can you see on the first screenshot
See first issue.
11/27/2011 10:41:42 AM michael (at) bigmichi1 (dot) de New Attachment: config.jpg Download
 
11/27/2011 10:41:15 AM michael (at) bigmichi1 (dot) de Comment #1
Priority ⇒ 1. Low
State ⇒ Unconfirmed
New Attachment: block.jpg Download
Patch ⇒ No
Milestone ⇒
Queue ⇒ Horde Framework Packages
Summary ⇒ some issues with the new weather block
Type ⇒ Bug
Reply to this comment
first one is that there is sometimes the entire translation file 
displayed, from my simple point of view, have a look at the first 
screenshot.
the second one is that temperature is still in F, but i configured 
metrics in block configuration see second screenshot
the thirsd on is that some things are not translated, like sunny as 
can you see on the first screenshot

Saved Queries