Closed (fixed)
Project:
Webform
Version:
8.x-5.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Mar 2021 at 15:07 UTC
Updated:
22 Oct 2021 at 09:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
dsdeiz commentedComment #3
gg24 commentedHi,
I created a webform -
Where I created two pages.
- The first page had a Textarea field as a required field.
- Second page had two Textareas where both are required but the first is hidden and the second is not.
Now when we test the webform -
On the first page, the Textarea appears and on the second page, only Textarea which is not hidden appears. There are no issues in hidden required elements. Please refer to the screenshot attached.
There is a setting which makes sure that hidden element shouldn't be required. Attaching the screenshot along.
Hence closing the issue. Please feel free to open it again if the issue still persists.
Comment #4
dsdeiz commentedYeah, noting this still happens on 5.x-dev even with the "Clear value(s) when hidden" (enabled by default). Yeah, still using the same config in a fresh Drupal install and using the same steps as mentioned above.
Comment #5
paulocsI could reproduce the error with the webform example provided in IS.
A quick workaround for you is to set
name_1field as optional ifadd_memberfield is unchecked.Comment #6
jrockowitz commentedThe issue is the Type radio button's value is not being cleared when it is hidden. It is very tricky to clear a radio button's value and post the empty value back to the server.
Comment #7
jrockowitz commentedAttached is an MVP patch that calls \Drupal\webform\WebformSubmissionConditionsValidator::submitForm before the validation.
If all tests pass we might want to refactor the WebformSubmissionConditionsValidator service and create a protected WebformSubmissionConditionsValidator::processForm method.
Comment #8
jrockowitz commentedHere is the same patch with the refactoring.
Comment #11
jrockowitz commented