Download & Extend

Fatal error if block is used

Project:Yahoo Weather Forecast
Version:6.x-1.3
Component:Code
Category:bug report
Priority:major
Assigned:Unassigned
Status:active

Issue Summary

Hello,

I get the following problem if I use the YWF 6.x-1.3 and also with YWF 6.x-1.x (dev):

Fatal error: Cannot use string offset as an array in .../sites/all/modules/yahoo_weather_forecast/yahoo_weather_forecast.module on line 415

I use Drupal 6.16.

Creating a City is okay but if I try to add the created block in Site Building -> Blocks to a region the above error raises up.

Regards,
dokuf

Comments

#1

Hi dokuf

i have resolved this problem , the problem is in database because there the "data" filed its not passing any value there form this module the default set is not null make it null problem is solved pls try this

regards
jayaprakash

#2

Priority:critical» normal

Sorry jayaprakash, but I didn't get your reply.

But it gave me a good hint where to look at to find the reason for the problem I have. So if I have a look at the field 'data' in the DB table 'yahoo_weather_forecast_blocks' I can see that the module did not get any data from yahoo as the city code was not recognised! I experimented some times to find the right code (only the number in the yahoo link) and now it works.

But I would have expected to get an error message from the module if the city code is not recognised and no crash if a block with unknown city is used. So I think these are two things to fix.

Regards,
dokuf

#3

Hi there,

I receive the same error. But it has nothing to do with the Drupal 6.x version.

With a different installation I have no problems. There I use "Yahoo Weather Forecast 6.x-1.0"

The main difference to the 6.x-1.3 is that no separate DB for the block exist in 6.x-1.0.

In 6.x-1.0. all informations are in the db variable. The var names begin all with yahoo_weather_forecast

rgds,
Andreas

#4

Ok, I checked the code.

This error occures if a wrong WOEID is used. Check at the Yahoo pages http://developer.yahoo.com/weather/

Here what they writing.

http://weather.yahooapis.com/forecastrss?w=2502265

The location parameter needs to be a WOEID. To find your WOEID, browse or search for your city from the Weather home page. The WOEID is in the URL for the forecast page for that city. You can also get the WOEID by entering your zip code on the home page. For example, if you search for Los Angeles on the Weather home page, the forecast page for that city is http://weather.yahoo.com/united-states/california/los-angeles-2442047/. The WOEID is 2442047.

In the file yahoo_weather_forecast.module this informations are requested on line 521.

As soon as you're using the right number (WOEID) it should work.

rgds,

Andreas

#5

I changed the WOEID and it still is giving me a fatal error. This is a serious problem, methinks.

#6

Started over from scratch, and it looks like it works now, although I got another bug somewhere else which mysteriously went away.

I tried to modify the WOEID in the DB, but that didn't fix it. I just deleted the record, and then created a new block using the correct WOEID and it appeared to work better.

However, once I noticed that the output does not include class or id's in the HTML tags I relealized I can't customize this using CSS unless I do some PHP theming.

1) This bug needs to be fixed
2) In the screenshot of this module you use the incorrect WOEID (USCA0987) code, which apparently will cause a fatal error
3) You don't include classes or ID's to make stylizing with CSS simpler

#7

Priority:normal» major

I confirm, same error here. Solved by entering the right code. This needs fixing. What if yahoo server is down or replies bogus data? will this break my site :) ?

nobody click here