Problem/Motivation

While configuring the form display for a custom content type, I noticed that If I selected the form display option for the geolocation field widget Automatically push retrieved address data to address field widget (Only available if the field widget is set to Geolocation Google Maps API - Geocoding and Map), that the address field widget does not automatically get updated, as the options title indicated that it should.

The geolocation field has the following widget options:

  • Automatically use client location, when no value is set: TRUE
  • Automatically push retrieved address data to address field widget: TRUE
  • Select target field to append address data. This is set to the address field

The address field has the following widget options:

  • Default Country: Denmark

If I enable the option Use explicite push/locate buttons to interact with address field widget, and use the button on the map to get the address, I noticed an additional bug, the address is filled in wrong, it types the house number before the street name, instead of the other way round. While the order in which the house number and street name is entered can vary based on the country, it should use the country that is defined in the address field widget.

Comments

Dionsj created an issue. See original summary.

dionsj’s picture

Issue summary: View changes
dionsj’s picture

Issue summary: View changes

fixed broken markup in issue text

dionsj’s picture

Issue summary: View changes

Clarifying description, I had removed some text before submitting the initial issue, and it left some parts of the description without context.

flodevelop’s picture

Hello, did you try the patch from this issue ?

dionsj’s picture

@Flodevelop,

Sorry for the late answer, no I haven't tried that patch out, as I only found the bug when playing around with the modules, I do not use a setup that would require this functionality at present time, and don't really have enough time to test if the mentioned patch fixes the issue.

Feel free to close the issue, someone can always reopen it if needed.

peacog’s picture

Status: Active » Needs review
StatusFileSize
new4.57 KB

This is the same bug as the one raised in #2847443: Push from Google map to Address field broken after Address module update. The explicite_actions_address_field is defined as a string rather than a boolean, and for this reason the javascript comparisons in geolocation-widget-googlegeocoder.js don't work. In the other issue I tried to fix the bug by changing the schema, but the fix didn't get committed, maybe because the maintainer didn't like the schema change. So I've approached it a different way in this patch, with an explicit comparison with the "0" string.

Note I haven't addressed the second bug raised here, where house number comes before street name.

peacog’s picture

StatusFileSize
new5.31 KB

Here's a better patch. The value of explicite_actions_address_field when not selected can be either "" or "0" so must check for both.

I also fixed a small spelling mistake :)

Status: Needs review » Needs work

The last submitted patch, 8: geolocation-2879662-8.patch, failed testing. View results

peacog’s picture

Status: Needs work » Needs review
recrit’s picture

StatusFileSize
new1.1 KB

@Peacog, this is easier to handle server side and then keep the JavaScript as is.
Attached is the 1 line field when processing the widget settings.

peacog’s picture

StatusFileSize
new729 bytes
new1.62 KB

Thanks @recrit, that's much better! I've just added the small spelling fix.

christianadamski’s picture

Hey @Peacog,

I earlier committed https://www.drupal.org/node/2892036 which solved this. I will however commit your typo fix. Sadly we can't fix it in the setting itself.

  • Peacog authored cb68b54 on 8.x-1.x
    Issue #2879662 by Peacog, recrit: Geolocation field widget does not...
christianadamski’s picture

Status: Needs review » Fixed

Thanks

Status: Fixed » Closed (fixed)

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