I'm newbie using Geocode, but I'm trying o use it and I can´t geocode anything. When I save a new node, Druapl always return this error:
.
warning: Invalid argument supplied for foreach() in C:\AppServ\www\drupal\sites\all\modules\geocode\modules\geocode_widget\geocode_widget.module on line 71.
$geo_field['widget']['geocode_fields'] is always null.
Thanks!!
Comments
Comment #1
manski2 commentedSame thing here, followed the instructions in http://www.geojune.org/doc/getting-started-mapping/drupal-mapping-cookbo..., and nothing but this error appears repeatedly.
Comment #2
manski2 commentedI somehow got the correct fields to show up by adding 'text' to the list that included 'textfield' in (http://drupal.org/node/416506) but it's still not geocoding anything for me.
how / when does that happen?
John
Comment #3
tstoecklerMarked #520744: Error in geocode_widget.module as a duplicate.
There I had the same issue as described above.
Comment #4
gagarine commentedI follow the #2 and change in ligne 64 of geocode.module
to
And the field show up but "Return value" only have "point" instead of all return type (it's normal?):
EDIT: ok return value need to be a point apparently... but anyway nothing is returned and the field stay empty. I don't understand where in the code the geocode should be do.
EDIT2: Ok ok.. my IDE don't refresh all files... in finally found the geocode.inc hum... take a look tomorrow to see what append and why no geocoded value is returned.
sorry time to sleep for me i think.
Comment #5
gagarine commentedComment #6
tstoecklerMore descriptive title
Comment #7
tauno commentedI looked into this a bit based on #4 and it looks like the the format of $values that geocode() is returning is different from the format of the form field. In my testing I'm using a text field with unlimited values as the source for my geocode field (which also allows unlimited values).
To get any return values from geocode() I made this adjustment:
In geocode_widget.module, geocode_widget_form_validate() I changed line 76 from
to:
Now $values has the right values, but the format seems wrong for the form_set_value() call
print_r($values):
(strange that field_locations_add_more was geocoded too...)
and where we're trying to put the values...
print_r($form['geo_field_name']):
So it looks like $values is using wkt, lat, lon and the field actually has srid, wkb, bbox, centroid.
I also just saw a geo issue that may be related: #489818: geo_field fields not storing data
Comment #8
allie mickaI daresay this is fixed in CVS.
Thanks!
Comment #9
gagarine commentedPerhaps a stupid question but why the "6.x-1.x-dev" package on the geocode project page is not automatically updated? This is not the same branch? Can you provide a package from the HEAD?
Comment #10
tstoecklerCreated new issue:
#557096: Geocode 6.x-dev release not updated