after update to current release, the location_save() method produce an sql error. Server configuration and database has GERMAN language.

PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect decimal value: '48,1366069' for column 'latitude' at row 1: INSERT INTO {location} (name, street, additional, city, province, postal_code, country, latitude, longitude, source, is_primary) 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, :db_insert_placeholder_10); Array ( [:db_insert_placeholder_0] => test [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => [:db_insert_placeholder_3] => München [:db_insert_placeholder_4] => BY [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => de [:db_insert_placeholder_7] => 48,1366069 [:db_insert_placeholder_8] => 11,5770851 [:db_insert_placeholder_9] => 3 [:db_insert_placeholder_10] => 0 ) in drupal_write_record() (line 7136 of /var/www/triafreun.de/docs_d7/includes/common.inc).

Comments

fragtom’s picture

StatusFileSize
new622 bytes

I've done rudimentary fix for solving that .. but I don't know the drupal-way to make sure the value right for db-insert.

fragtom’s picture

StatusFileSize
new622 bytes

Uploaded patch again

Tarnjit’s picture

Hello,
I have managed to produce this error:

"PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect decimal value: '' for column 'latitude' at row 1: INSERT INTO {location} (name, street, additional, city, province, postal_code, country, latitude, longitude, source, is_primary) VALUES (:db_insert_placeholder_0, ..."

both before and after applying the patch given above. Anybody out there have any ideas?

zwerg’s picture

After applying the patch I get these messages when I add a node with location:

  • Notice: A non well formed numeric value encountered in location_save() (Zeile 1366 von /xxx/location.module).
  • Notice: A non well formed numeric value encountered in location_save() (Zeile 1367 von /xxx/location.module).
alforddm’s picture

Issue summary:View changes

I have gotten this error if I choose a location that is not an actual post office location but a small town within the zipcode. For example I get it if I try to enter a location with Tom, Oklahoma. Tom is not an actual address but a rural "village". It's post office box is actually Haworth, ok. However, if you enter Tom into google maps it is found and coordinates are returned. Here is what is getting returned with the error.

PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect decimal value: '33.74751</latitude><longitude>-94.57289</longitude><offsetlat>33.74751</offsetlat><offsetlon>-94.57289</offsetlon><radius>1900</' for column 'latitude' at row 1: INSERT INTO {location} (name, street, additional, city, province, postal_code, country, latitude, longitude, source, is_primary) 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, :db_insert_placeholder_10); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => [:db_insert_placeholder_3] => tom [:db_insert_placeholder_4] => OK [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => us [:db_insert_placeholder_7] => 33.74751</latitude><longitude>-94.57289</longitude><offsetlat>33.74751</offsetlat><offsetlon>-94.57289</offsetlon><radius>1900</radius><name/><line1/><line2>Tom, Haworth, OK</line2><line3/><line4>United States</line4><house/><street/><xstreet/><unittype/><unit/><neighborhood>Tom</neighborhood><city>Haworth</city><county>McCurtain County</county><state>Oklahoma</state><country>United States</country><countrycode>US</countrycode><statecode>OK</statecode><countycode/><uzip>74740</uzip><hash/><woeid>2418917</woeid><woetype>7</woetype></Result><Result><quality>50</quality><latitude>33.747509 [:db_insert_placeholder_8] => -94.57289</longitude><offsetlat>33.74751</offsetlat><offsetlon>-94.57289</offsetlon><radius>1900</radius><name/><line1/><line2>Tom, Haworth, OK</line2><line3/><line4>United States</line4><house/><street/><xstreet/><unittype/><unit/><neighborhood>Tom</neighborhood><city>Haworth</city><county>McCurtain County</county><state>Oklahoma</state><country>United States</country><countrycode>US</countrycode><statecode>OK</statecode><countycode/><uzip>74740</uzip><hash/><woeid>2418917</woeid><woetype>7</woetype></Result><Result><quality>50</quality><latitude>33.747509</latitude><longitude>-94.572891 [:db_insert_placeholder_9] => 3 [:db_insert_placeholder_10] => 0 ) in drupal_write_record() (line 7194 of /home/daylene/www/clava/includes/common.inc).
alforddm’s picture

I was just testing this further and it appears to only happen if a street address is not entered with the city/state. Enter a bogus street address along with Tom, OK and it will save without the error.

alforddm’s picture

Never Mind this was entirely my fault and I discovered what I did.