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

zabelc’s picture

Priority: Normal » Major

I'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

 if( isset($newloc) && is_array($newloc) ){

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.

darin73’s picture

I have the same problem.

BenK’s picture

Subscribing

macman91’s picture

Same problem here is a fix going to be issued?

David D’s picture

I 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.

aristeides’s picture

Confirming.... Node locations are saved but not CCK location fields.

bryancasler’s picture

We'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

goldlilys’s picture

Subscribing.

Happening for me too. Saving in node locations is fine, but when using location as cck field, nothing is saved.

ben kuper’s picture

subscribing

paulgemini’s picture

zabelc - could you be more specific in your changes (so I can create a patch) or upload a patch? Would really appreciate it!

zabelc’s picture

@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...

paulgemini’s picture

No worries. The error's still present though. 7.x-4.x is now usable...if a bit buggy.

manop’s picture

I 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.