When I submit a user location that is in the 59.xxxx 10.xxxx (this is the Oslo region - all users are there) then it ends up in the location table as 59.000000, 10.000000
In the _gmap_location_store_location function - the $object->gmap_location_latitude and $object->gmap_location_longitude are correct - with all decimals present (the .xxxxxxx) - so I can't see why the save of new or update of existing call to db_query is nulling them. After all - they are set as %f fields - isn't that correct?
Am very confused - would love a hint as to what may be wrong.
I can manually set the location fields to the correct value in the database and then they are shown correctly in the map views - so the database accepts these values itself.
Comments
Comment #1
chrissearle commentedDevel module shows the following update being called:
UPDATE location SET latitude='59,9292590183', longitude='10,7346725464', source='1' WHERE eid='4' AND type='user'The - in MySQL client - select * from location where eid=4 and type='user' gives:
So - I paste in the update call to the mysql client, run it and then run the select again and no change.
But - if I change the , (comma) to . (dot) in both long/lat values it works.
Oddly - the submitted page had . (dot).
So - the question becomes - what changes the . (dot) to , (comma) at submit?
Comment #2
bdragon commentedEuropean number format?
Comment #3
chrissearle commentedWhere would that be set? Database is set to unicode_generic.
The site I have where this is drupal 5 does not have this issue - same database encoding. So - a PHP setting? A drupal setting?
Comment #4
chrissearle commentedsry - for unicode_generic read utf8 general for the collation name.
Comment #5
bdragon commentedLocale setting.
What does the following print out?
Comment #6
chrissearle commentedThis was taken using the devel execute php block - hope that's OK.
Comment #7
bdragon commentedpossibly not... devel.module at at least one point in its life has set the locale to C (according to a grep of the repository), which may be masking the issue.
Comment #8
DGvNp0niToyRspXaaqx3PiQBMn66QXyAq5yrNHpz commentedI'm having this same issue. I am attempting to save form data containing decimal information. However, it is not saving the decimal into the database. It saves the 2 decimal places as
.00This is the form field I am attempting to save:
This is the submit function I am using:
This is the database settings I am using:
field: market_share
type: decimal
length: 3,2
This is the print out of my locale settings (NOT through Devel):
Any ideas on solving this are greatly appreciated.
Thanks,
Josh
Comment #9
bdragon commentedJosh, YOUR issue is that you're using %d when you mean %f. Also you have a bunch of spurious single quotes in your queries. Please read the documentation for db_query carefully.
As for the original issue, I'm assuming it was a locale related problem.
Closing.