Installed modules:

Addressfield 7.x-1.0-beta5
Geocoder 7.x-1.x-dev
Geofield 7.x-1.2
Geofield Map 7.x-1.1

Steps to repeat:

1. Install above modules
2. Add new address field to a content type
3. Add new geofield to content type. Set values:

  • Geocode from field: Choose the address field created in step 2
  • Geocoder: Google Geocoder

4. Edit content type display settings and set the format for the geofield to Geofield Map
5. Create new node and leave the address field blank

Expected Results:

Node should show only fields that have been filled in, and should not display any map output since all address fields were left blank.

Actual Results:

  • Node displays a Google map with a pin at coordinates 37.0902 , -95.7129.
  • An entry is created in field_data_[geofield_name] with these coordinates

Notes:

Logic inside geocoder_widget_get_field_value retrieves source values but doesn't seem to do enough checking to see whether the fields are blank, and geocodes anyway.

Similar issues:

https://drupal.org/node/1592096

Thanks in advance!

Comments

vinmassaro’s picture

Issue summary: View changes
Simon Georges’s picture

Status: Active » Postponed (maintainer needs more info)

Did you try with the latest 7.x-1.x-dev version?

vinmassaro’s picture

Version: 7.x-1.2 » 7.x-1.x-dev
Status: Postponed (maintainer needs more info) » Active

Still have the issue with 7.x-1.x-dev so I'm reopening. Following my steps above result in it geocoding to Afghanistan, 33.9391, 67.71.

Simon Georges’s picture

Ok, thanks for the feedback!

Khalor’s picture

#2114183: Don't geocode for location data if the addressfield is empty resolved this for addressfields by adding logic in each individual handler. So far as I can tell it's still an issue for generic fields though.

Pol’s picture

Status: Active » Closed (outdated)