Problem/Motivation
The options in the 'geocode from field' on the field UI edit form include all fields of the entity type. This contradicts the code in the geocoder_field_widget_settings_form() that initially restricts the list to fields on the entity bundle. The other fields on all bundles of the entity type are incorrectly included by the call to entity_get_all_property_info().
To reproduce the problem, simply add a geocoder field to a bundle and look at the list of options in the select element on the field instance settings form.
Proposed resolution
Replace the call to entity_get_all_property_info() with entity_get_property_info().
Remaining tasks
Review. Are there test assertions to be changed?
User interface changes
No change, just less options in select element.
API changes
None.
Data model changes
None.
Comments
Comment #2
solotandem CreditAttribution: solotandem commentedAttached patch implements proposed resolution (and adds missing new line to end of file).
Comment #3
solotandem CreditAttribution: solotandem commentedRegarding the 7.x-2.x branch:
- this bug is also present in geocoder_field_field_widget_settings_form()
- in addition, the above form builder also appears to have lost the filtering on 'all valid fields that we both support' as the code snippet below indicates all entity fields are added to $valid_fields
I will leave it someone else to port this patch to the 2.x branch.
Comment #4
solotandem CreditAttribution: solotandem commentedAttached patch implements proposed resolution (it removes the added new line in earlier patch and applies to latest stable release).
Comment #6
PolThanks!
Comment #8
Johan den Hollander CreditAttribution: Johan den Hollander at Finalist commentedPretty sure this broke the entity_property_info_alter implementation of this module.
This is my code
$info before and after: