Problem/Motivation
When using the geolocation_address with field synchronization, there is a call to clear the inputs whenever you click anywhere else on the map.
When the address is required and the country only has one option, this value gets written as a type="hidden".
Clicking on the map to synchronize the fields causes this hidden field to be cleared which then causes synchronization to stop working because there is a check in the callback to write data to make sure the values are identical. Since this is cleared and the field is hidden, it's impossible to get back the synchronization.
Steps to reproduce
Add an address field:
* Required
* Only one allowed country
* Default value of that country
Add a geolocation field:
* Use a map widget with synchronization enabled.
Go to the node add form and open the inspector. Inside the address fieldset, there will be a country_code input of type="hidden" with value="".
This in turn causes synchronization with no possibility to enable it again (since the input is hidden) because the map widget has this check:
addressInput.find('.country').val() === addressInputData.address.countryCode
Proposed resolution
Don't clear hidden inputs when removing form values.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | geolocation-3213381-2.patch | 729 bytes | kevineinarsson |
Comments
Comment #2
kevineinarsson commentedProposed patch for the issue.
Comment #3
kevineinarsson commentedComment #5
christianadamski commentedThanks!