Skip to content

fix(#7794): populate relation widget from url#7806

Open
lydiascarf wants to merge 2 commits intodecaporg:mainfrom
lydiascarf:7794-plural-query-param-prepopulation
Open

fix(#7794): populate relation widget from url#7806
lydiascarf wants to merge 2 commits intodecaporg:mainfrom
lydiascarf:7794-plural-query-param-prepopulation

Conversation

@lydiascarf
Copy link
Copy Markdown

@lydiascarf lydiascarf commented May 8, 2026

The createEmptyDraft action creator didn't combine repeated query params into a List, instead returning the last param. Now relation widgets with isMultiple set will populate correctly. Please let me know when you think this could be deployed as I have an event I'd like to use this feature during on starting the week of the 18th.

closes #7794

Summary

I have a collection with a relation widget that needs to pre-populate from query params. This was working fine without isMultiple set to true on the field, but it didn't work if isMultiple was set to true. I changed the action creator responsible for parsing the query params to handle repeated values as Lists.

Test plan

Ran development server and found the following isMultiple: true relation field then entered a repeated post query param. Added a unit test to the relevant action creator.

Screenshot 2026-05-08 at 12 25 04 PM

Checklist

Please add a x inside each checkbox:

A picture of a cute animal (not mandatory but encouraged)

6C78CC96-4C23-43CA-A063-CB3BCC6D3AD5_1_105_c

@lydiascarf lydiascarf requested a review from a team as a code owner May 8, 2026 10:54
@lydiascarf lydiascarf force-pushed the 7794-plural-query-param-prepopulation branch from 0b6f189 to db98daf Compare May 8, 2026 10:55
The createEmptyDraft action creator didn't combine repeated query params
into a List, instead returning the last param. Now relation widgets with
isMultiple set will populate correctly.
@lydiascarf lydiascarf force-pushed the 7794-plural-query-param-prepopulation branch from db98daf to 6d74c63 Compare May 8, 2026 11:24
Copy link
Copy Markdown
Contributor

@yanthomasdev yanthomasdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @lydiascarf, LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using query params to pre-populate the editor on a relation widget with multiple set to true

2 participants