Problem/Motivation

The JS logic selects the field only by name, and my understanding is that it will then as a result always pick the first.

I started making this more specific by using a more specific selector for the geolocation widget and then attempting to find the address field as a sibling first.

That part seems to work, but it doesn't yet fill out the address, there's more work to be done here.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

berdir created an issue. See original summary.

berdir’s picture

Status: Active » Needs work

I opened a merge request against 8.x-3.x for now since that's what we're using. I think the problem also exists in 4.x, the change doesn't apply but it doesn't seem to be doing anything that would improve this.

berdir’s picture

Status: Needs work » Needs review

Found the problem, I had to use the full name as key to allow separate configurations for each.

christianadamski’s picture

Could you in more detail describe the scenario? What would I have to set up to recreate this?

berdir’s picture

Create a paragraph type with a geolocation + address field and a paragraph field that allows multiple values.

Imagine a company node type with multiple locations, each location is a map with address + other infos, like opening hours or so. you could kind of build that with single field and multiple values each, but if you also want to

Note that you will also run into #3480206: Geolocation Field in combination with Paragraphs (Ajax/Modal) handling when trying to do that as html_head apparently can't be added through an ajax response, so if you don't load any geolocation fields initially, it won't work. (this scenario would work I guess if you set the paragraph widget to use such a location paragraph type by default.

christianadamski’s picture

I'm at DrupalCamp Berlin. Spend whole day looking at this. Not simple.

christianadamski’s picture

The parent form is still the node form. So I don't see an obvious way to clearly identify the matching address form element relative to the geolocation form.

Right now I think it will come done to CSS selector guessing :(

christianadamski’s picture

Status: Needs review » Postponed (maintainer needs more info)

v4 is fixed. You opened a MR for v3. I haven't tested it. Did you extensively? Can I merge blindly?

berdir’s picture

Status: Postponed (maintainer needs more info) » Needs review

The client confirmed it worked for their use case, but I didn't test it that extensively, and specifically didn't test if it still works for any other use case.

Feel free to leave it at needs review for others to confirm or just only fix it for 4.x, your call.

christianadamski’s picture

Version: 4.x-dev » 8.x-3.x-dev

v4 I already merged (and released) separately.

Hmm. Ok, I'll see if I get around to testing v3.

nicross-com’s picture

I did not test thoroughly, but MR!85 applies for me in v8.x-3.14, and it fixes this issue in my project. Thanks!