Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly handle array inputs in iframe-field-modal #2491

Merged
merged 1 commit into from
Jul 19, 2024

Conversation

RFSH
Copy link
Member

@RFSH RFSH commented Jul 19, 2024

Prior to merging #2340, array values were stored as strings in react-hook-form. So the iframe-field-modal.tsx code wasn't doing anything special for the arrays and populateSubmissionRow would eventually turn this string into a proper array.

However, with the new implementation, we expect array values to follow a specific pattern, and this PR will make sure this component also stores array values properly.

Because of this bug, after users select a value using the iframe, as soon as the populateSubmissionRow was called (due to opening a foreign key popup or clicking on submit), they would see a terminal error with the following message

l.map is not a function

P.S. I also changed the test case to have an array column, so we can test this scenario.

@RFSH RFSH added the bug label Jul 19, 2024
@RFSH RFSH requested a review from jrchudy July 19, 2024 17:55
@RFSH RFSH self-assigned this Jul 19, 2024
@RFSH RFSH merged commit 34f0506 into master Jul 19, 2024
1 check passed
@RFSH RFSH deleted the fix-input-iframe-array-submission branch July 19, 2024 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants