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.

CommentFileSizeAuthor
#2 geolocation-3213381-2.patch729 byteskevineinarsson

Comments

kevineinarsson created an issue. See original summary.

kevineinarsson’s picture

StatusFileSize
new729 bytes

Proposed patch for the issue.

kevineinarsson’s picture

Status: Active » Needs review

  • kevineinarsson authored a31c789 on 8.x-3.x
    Issue #3213381 by kevineinarsson: geolocation_address clears hidden...
christianadamski’s picture

Status: Needs review » Fixed

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.