Closed (fixed)
Project:
Webform
Version:
8.x-5.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
8 Aug 2017 at 16:38 UTC
Updated:
8 Sep 2017 at 18:45 UTC
Jump to comment: Most recent, Most recent file
Conditional logic using #states API only provides client side validation. The Webform module needs to support server side validation.
Provide server side validation for #states API.
Reuse #states API selectors and nomenclature to create a custom Webform specific server side conditional logic validator and manager
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | server_side_conditional-2900719-23.patch | 75.94 KB | jrockowitz |
| #20 | server_side_conditional-2900719-20.patch | 74.69 KB | jrockowitz |
| #7 | server_side_conditional-2900719-6.patch | 30.28 KB | jrockowitz |
Comments
Comment #2
jrockowitz commentedComment #7
jrockowitz commentedComment #15
jrockowitz commentedComment #20
jrockowitz commentedComment #23
jrockowitz commentedComment #26
jrockowitz commentedComment #27
katannshaw commented@jrockowitz: I attempted to apply your patch from #23 and received an error stating that the patch cannot be applied. Here's my setup
Changed webform version from 8.x-5.0-beta to 8.x-5.x-dev
Added your patch to composer.json like this:
"patches": {
"drupal/webform": {
"Server side Conditional Logic using #states API": "https://www.drupal.org/files/issues/server_side_conditional-2900719-23.p..."
}
}
Running `composer install --verbose` and `composer update drupal/webform --verbose` returned this result:
Do you have a suggestion on how I can fix this issue?
Kat
Comment #28
jrockowitz commentedThe patch has been committed to the latest dev release.
Comment #29
katannshaw commentedWell that was a brain fart moment... Thanks.
Comment #30
larowlanFYI - this should use the third argument.
https://3v4l.org/oPqTY
Comment #31
jrockowitz commentedI was not aware of the third argument. I am surprised that it is not used more frequently in core.
https://www.drupal.org/project/issues/drupal?text=in_array+strict&versio...
I created a ticket to #2903561: Review in_array() usage and add the strict argument as needed.
Comment #33
stiras commentedI am not sure if I can ask my question here or should I open a new issue, but since my question is related to that topic, I am posting it here.
I am using server-side conditional logic and everything works fine except for the file (document) upload field - it is marked as required but no validation is performed when no file is actually uploaded. When using required as FORM VALIDATION (not as CONDITIONAL LOGIC required) the validation works but that's not what I need.
Thanks for your help and time!
Comment #34
jrockowitz commentedPlease open a new ticket.