Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Geographical
-
Labels:None
-
Environment:Symphony 1.4, PostgreSQL 8.4.8
Description
Added "Geographical" behaviour to an entity:
ZipCode:
actAs: [Geographical]
columns:
code: string
[...]
Using the standard Symfony-generated admin manager, when trying to insert a new record without specifying both latitude and longitude, Doctrine generates a wrong INSERT statement for PostgreSQL, including latitude and longitude as '' (empty string)
Doctrine_Connection->exec('INSERT INTO zip_code (hidden, code, country_id, latitude, longitude) VALUES (?, ?, ?, ?, ?)', array('false', '20133', '1', '', ''))
This cause this error:
SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for type double precision: ""
Workaround
explicitly specifying float type for latitude and longitude...
actAs:
Geographical:
latitude: {type: float}
longitude: {type: float}
...still generate the column correctly as double precision in the database, but will not cause any error on inserting records.