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

fix: Repeated value fill with empty string not null #1340

Merged
merged 4 commits into from
Feb 6, 2025

Conversation

trebitowski
Copy link
Contributor

@trebitowski trebitowski commented Feb 4, 2025

Changes the default fill of repeated field arrays from null (which get ignored and indexes change) to "" (which will keep the indexes correct). If a field is passed into the array fill, we use that field's default value.

Testing:

  • Tested Ken's use-case where repeated, optional integer fields weren't submitted correctly and empty fields would be removed. Now the form results correctly show those optional fields as empty.
    • Integer fields when submitted with an empty "" value are maintained in the form results
  • Tested Checkbox fields inside repeated containers. These also now correctly reflect their state when submitted.
  • Fields inside a repeated container that have a default value also now submit their default value instead of blank if they are submitted.
  • Non repeated text and integer fields with and without default values are submitted correctly
  • Repeated submissions with the same data works since we transform field values on arrays from null to ""

Also on step submission, null values inside an integer field are converted to empty strings.

untitled

@trebitowski trebitowski requested a review from bo-dun-1 as a code owner February 4, 2025 19:04
@trebitowski trebitowski marked this pull request as draft February 5, 2025 16:25
@trebitowski trebitowski force-pushed the fix--repeated-value-null branch 2 times, most recently from a56db77 to 7b25efa Compare February 6, 2025 15:26
@trebitowski trebitowski force-pushed the fix--repeated-value-null branch from c69b900 to 9200e14 Compare February 6, 2025 15:42
@trebitowski trebitowski force-pushed the fix--repeated-value-null branch from 9200e14 to ea48cb4 Compare February 6, 2025 15:47
@trebitowski trebitowski marked this pull request as ready for review February 6, 2025 15:56
@trebitowski trebitowski force-pushed the fix--repeated-value-null branch 3 times, most recently from 9e58ae7 to ee0d211 Compare February 6, 2025 21:08
@trebitowski trebitowski force-pushed the fix--repeated-value-null branch from ee0d211 to 709b1af Compare February 6, 2025 21:11
@trebitowski trebitowski merged commit 0d8c753 into master Feb 6, 2025
6 checks passed
@trebitowski trebitowski deleted the fix--repeated-value-null branch February 6, 2025 22:18
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.

2 participants