I don't know if anyone else has had this problem, but for the longest time, I was unable to create a new weather block in drupal.

Everytime I tried, I would get a database error, because the INSERT query did not have any data for the "data" field. Upon looking through the code, I noticed the data field does not get populated until right after the INSERT query.

The fix is to add the "data" field to the INSERT query in the function yahoo_weather_forecast_settings_form_submit. I did this and added a value of NULL and I was able to get around the error. Not sure if that is the best way, but it is working for me.

$result = db_query("INSERT INTO {yahoo_weather_forecast_blocks} (zip_code, name_city, units, display_options, data) VALUES('%s', '%s', '%s', '%s', '%s')", $values['city_code'], $values['city_name'], $values['unit'], $options, null);

Considering that there isn't an open issue about this already, I assume it has to do with the versions of php and mysql I have. I am running php v5.3.2 and mysql v5.1.50 on my developmental machine. Anyway, just putting it out there if anyone else has trouble.

Comments

kbasarab’s picture

I ran into this same issue.

My solution was simply to change the data column to allow NULL values in the database:

ALTER TABLE yahoo_weather_forecast_blocks MODIFY COLUMN data longtext;