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.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | geolocation-2879662-12.patch | 1.62 KB | peacog |
| #12 | interdiff-2879662-11-12.txt | 729 bytes | peacog |
| #11 | geolocation-2879662-11.patch | 1.1 KB | recrit |
Comments
Comment #2
dionsjComment #3
dionsjfixed broken markup in issue text
Comment #4
dionsjClarifying description, I had removed some text before submitting the initial issue, and it left some parts of the description without context.
Comment #5
flodevelop commentedHello, did you try the patch from this issue ?
Comment #6
dionsj@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.
Comment #7
peacog commentedThis 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.
Comment #8
peacog commentedHere's a better patch. The value of
explicite_actions_address_fieldwhen not selected can be either "" or "0" so must check for both.I also fixed a small spelling mistake :)
Comment #10
peacog commentedComment #11
recrit commented@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.
Comment #12
peacog commentedThanks @recrit, that's much better! I've just added the small spelling fix.
Comment #13
christianadamski commentedHey @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.
Comment #15
christianadamski commentedThanks