0

I am trying to determine why, on certain nodes, my address fields are not geocoded to my geofield. I think I have it tracked down to this part of geocoder.widget.inc (line 347).

function geocoder_widget_get_entity_field_value($entity_type, $field_instance, $entity) {
    $field_name = is_array($field_instance['widget']['settings']['geocoder_field']) ? reset($field_instance['widget']['settings']['geocoder_field']) : $field_instance['widget']['settings']['geocoder_field'];

If I add dpm($field_instance), on one node update, it will show me that array. On a different node update, there is no devel message (i.e. no array). Both nodes have addresses.

The problem is, I cannot figure out why one would be blank while the other would not be.

  • Presumably you are using a service for the geocoding. There can be a number of reasons why a result is not returned but the commonest ones are exceeding query limits and address not recognised. Look for messages from the service in recent log messages. – Alfred Armstrong May 10 '18 at 9:39
0

Apparently this was an issue with the manual lat/lon override. I didn't have it checked to allow it, but when I did check it and edited the problem nodes, the override box was already checked. Unchecking it then allowed my address field to be geocoded.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.