Hello,
I'm running Drupal 7.26 with PostgreSQL 9.2.
After creating or updating the system-wide display (#1) , I get the following SQL error on the table weather_forecasts :

PDOException : SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "344.9" LINE 1: ...1:00:00', '2014-05-04 17:00:00', '2', '01d', '0', '344.9', '... ^: INSERT INTO weather_forecasts (geoid, time_from, time_to, period, symbol, precipitation, wind_direction, wind_speed, temperature, pressure) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array ( ) dans _weather_parse_forecast() (ligne 233 dans /home/pierrot/public_html/toupetigite/sites/all/modules/weather/weather_parser.inc).

It seems that the syntax of the wind direction (344.9) is invalid.

The block displays : "Currently, there is no weather information available"

Thanks,

PM

Comments

pal4life’s picture

HI,
Please provide Steps to reproduce as per
https://drupal.org/contributor-tasks/add-steps-to-reproduce

Thanks.

PierreM48’s picture

Steps to reproduce the problem

Config : Drupal 7.26, PostgreSQL 9.2, theme : Omega

(Re-)install weather 2.5

admin > config > user interface > weather > add display
Temp : Celsius
Wind speed : m/s
Pressure : hPa
Distances : km
display windchill temp and shortened wind directions

Add a location to system-wide display #1 : France / Paris / Paris / Weight 0
Nbr of forecast days : 2

admin > structure > block
assign the system-wide display #1 to a region

The first time that region is displayed, you get the error.

More seriously, PostgreSQL is very strict about data types (I don't know MySql):
The string '344.9' (wind direction, see above) is NOT an integer

In the table 'weather_forecasts',
- the fields wind_direction and pressure must be of type 'double precision' instead of 'integer'
- the field 'period' must be 'integer' instead of 'character varying'

After making manually these changes, the module is running.

I have to thank you for this interesting module, but I do not understand why, on the project page, it is said "Works well with any database".

toddy’s picture

Title: Table weather_forecasts not filled in » Table weather_forecasts not filled in on PostgreSQL
Assigned: Unassigned » toddy
Issue tags: -Needs steps to reproduce

Hi,

many thanks for reporting this bug. It's indeed an error in the database handling of the module. I'll fix this in the next release, then you should be able to use this module on PostgreSQL without manual tweaks.

Regards,
Tobias

toddy’s picture

Status: Active » Fixed

This is fixed now and will be part of the next release.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.