[Fix] Mapping issues between a dropdown with multiple answers and it's form destination - #1277
Open
jdurand-teclib wants to merge 3 commits into
Open
jdurand-teclib wants to merge 3 commits into
jdurand-teclib wants to merge 3 commits into
Conversation
jdurand-teclib
requested review from
Herafia,
Lainow,
Mary-Clb,
MyvTsv and
RomainLvr
September 29, 2026 11:31
Mary-Clb
approved these changes
Sep 30, 2026
Rom1-B
self-requested a review
September 30, 2026 12:41
Rom1-B
reviewed
Sep 30, 2026
| QuestionTypeItemDropdown::class, | ||
| ]); | ||
|
|
||
| foreach ($answers as $answer) { |
Contributor
There was a problem hiding this comment.
Pre-existing bug in this loop, not introduced here, but worth fixing while you're in this function: $value (set line 116) is never reset per iteration, so a text/date/etc. answer processed right after a QuestionTypeItemDropdown answer silently reuses the previous answer's value via the ?? fallback at line 148.
Suggested change
| foreach ($answers as $answer) { | |
| $value = null; |
|
|
||
| ### Fixed | ||
|
|
||
| - Fix value mapping between a multiple dropdown field and it's destination in a form |
Contributor
There was a problem hiding this comment.
Suggested change
| - Fix value mapping between a multiple dropdown field and it's destination in a form | |
| - Fix value mapping between a multiple dropdown field and its destination in a form |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Important
Change of behavior: As a form already has default values, deleting pre-written default answer to a question when filling the form was actually replacing it by field's default value, whereas it would be more logical to imagine that the user actually wanted to leave the form blank.
Logic is consistent the other way around with a default value in the field but not in the form, as the user has no idea of the field configuration, he would find himself with values on a field he left blank.
The previous behavior was not documented on gitbook.