Here is my scenario:

I have an entity with a multivalue addressfield and a geofield that geocodes addresses from that field. Adding another address to an existing address field does not trigger a geocode on the field.

In geocoder_widget_get_field_value() the call to geocoder_widget_array_recursive_diff() seems to have the parameters in the wrong order:

if (!empty($field_original) && !empty($target_original)) {
  $diff = geocoder_widget_array_recursive_diff($field_original, $source_field_values);
  if (empty($diff)) {
    return FALSE;
  }
}

Since geocoder_widget_array_recursive_diff() works like PHP's array_diff() in that it returns the elements in array1 that are not in array2, it seems like this snippet will return FALSE even if $source_field_values (the new values) has a new item.

The attached patch reverses the parameters.

CommentFileSizeAuthor
multivalue_field_additions.patch913 bytestimhsieh
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

timhsieh created an issue. See original summary.

rudiedirkx’s picture

Status: Needs review » Needs work
Related issues: +#1515372: Caching Results

Actually they have to work both ways. You have to compare A with B, and B with A.

This will be fixed when #1515372: Caching Results is implemented.

Pol’s picture

Status: Needs work » Closed (outdated)