Trying to import content with multiple values mapped to a target using 'geofield_set_target_smimple' will not work. Here is a simple patch to fix this. I had this problem trying to import content with multiple 'lat' and 'lon', values.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gnucifer’s picture

gnucifer’s picture

Status: Active » Needs review
joelpittet’s picture

Status: Needs review » Needs work
+++ b/geofield.feeds.inc
@@ -132,7 +132,12 @@ function geofield_feeds_processor_targets_alter(&$targets, $entity_type,
+    $entity->{$field_name}['und'][$delta][$sub_field] = $val;

LANGUAGE_NONE instead of 'und' please.

and space after if start.

Also just a trick. You can cast an value to an array and it won't effect your original array. $values = (array) $value; will do what you are doing without the is_array check.

Otherwise nice fix.

joelpittet’s picture

Status: Needs work » Closed (duplicate)

Actually this doesn't apply any more and seems to be resolved. I'm closing as a duplicate.

joelpittet’s picture

+++ b/geofield.feeds.inc
@@ -132,7 +132,12 @@ function geofield_feeds_processor_targets_alter(&$targets, $entity_type,
+    $values = array($value);
...
+  foreach($value as $delta => $val) {

Also you should remove this patch because $values is the array but it's looping through $value (not plural)