Active
Project:
Location
Version:
7.x-4.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Jan 2011 at 13:44 UTC
Updated:
30 Jul 2011 at 21:23 UTC
Just reporting problems I encounter....
On a fresh D7 installation I added a Location field and after configuring it, when I hit "save" I received these errors:
Warning: Invalid argument supplied for foreach() in location_strip() (line 1334 of /var/www/sites/all/modules/location/location.module).
Warning: Invalid argument supplied for foreach() in location_calc_difference() (line 1235 of /var/www/sites/all/modules/location/location.module).
Comments
Comment #1
zabelc commentedI'm getting the same error while trying to save a location field, and it's actually preventing me from saving any locations, so I'd submit that it's at least a major bug.
I did a bit of digging, and it appears that the location I'm setting in the form isn't being passed to location_calc_difference. In my debugging I've discovered that the value of $newloc is always null when it's passed to function location_calc_difference($oldloc, $newloc, &$changes) in location.module.
I got around the error by adding
before the errors in location_strip() and location_calc_difference().
Nevertheless, it appears that the new location never makes it out of the form, and even though I've managed to suppress the errors, neither the street address nor the lat/long coordinates are saved when I create or update nodes with a location field.
Comment #2
darin73 commentedI have the same problem.
Comment #3
BenK commentedSubscribing
Comment #4
macman91 commentedSame problem here is a fix going to be issued?
Comment #5
David D commentedI think I may have the same problem. I'm using Location CCK fields, and v. 7.x-3.x-dev (that having been recommended as being more stable). I try to save data in the fields, and the save is reported as successful, but the fields are emptied.
Comment #6
aristeides commentedConfirming.... Node locations are saved but not CCK location fields.
Comment #7
bryancasler commentedWe've been talking about location data not saving over here, feel free to check it out and contribute.
#1064666: Location CCK not saving for entities other than nodes
Comment #8
goldlilys commentedSubscribing.
Happening for me too. Saving in node locations is fine, but when using location as cck field, nothing is saved.
Comment #9
ben kuper commentedsubscribing
Comment #10
paulgemini commentedzabelc - could you be more specific in your changes (so I can create a patch) or upload a patch? Would really appreciate it!
Comment #11
zabelc commented@paulgemini, I'm actually on 7.x-3.x right now, so I'm no longer even using that fix. That said, it's it's been so long, that this error may have become OBE. ...sorry I can't help...
Comment #12
paulgemini commentedNo worries. The error's still present though. 7.x-4.x is now usable...if a bit buggy.
Comment #13
manop commentedI got this error when I use 7.x-4.x dev so I switch back to 7.x-3.x dev then it works fine.
In my understanding after reading this post http://drupal.org/node/1064666#comment-4206574 I believed that 7.x-4.x might take more times to finish.