I have a rather lengthy form that I have decided to break into multiple steps. Each step has required fields however I cannot get passed the first step because it shows form validations for fields on other steps. What I find interesting, is that it isn't all required fields from each step just the same five from varying steps. Because of this discrepancy, I thought that there could be a syntax issue with the yaml I used to create these five questions. However, after re-building those using the yaml_ui, I still have the same issue.

Attached is a screenshot, if there is any other helpful information I can provide, please let me know.

Thanks.

Comments

robpowell created an issue. See original summary.

jrockowitz’s picture

@robpowell My best guess is a certain element type is triggering validation even when it is hidden.

Can you please export and upload your form/example here without any email addresses?

You will need to enable the YAML Form devel module and see https://www.youtube.com/watch?v=ejzx4D0ldl0

robpowell’s picture

StatusFileSize
new49.88 KB

Thanks here are the line #s for the questions that are causing errors:

  • partner : 24
  • background : 1310
  • birth-control : 1411
  • hear about study : 1571
  • complete survey : 1583
jrockowitz’s picture

StatusFileSize
new5.83 KB

Attached patch fixes the validation issue. It still needs some tests.

jrockowitz’s picture

Status: Needs work » Needs review

  • jrockowitz committed df7bca3 on 2788117-multistep-validation
    Issue #2788117 by jrockowitz, robpowell: Multistep validation issues
    

  • jrockowitz committed 4ebd24a on 2788117-multistep-validation
    Issue #2788117 by jrockowitz, robpowell: Multistep validation issues.
    
jrockowitz’s picture

StatusFileSize
new37.18 KB

Here is the patch with tests.

Status: Needs review » Needs work

The last submitted patch, 8: multistep_validation-2788117-8.patch, failed testing.

jrockowitz’s picture

Status: Needs work » Needs review
StatusFileSize
new8.73 KB

  • jrockowitz committed 1f8cc6f on 8.x-1.x
    Issue #2788117 by jrockowitz, robpowell: Multistep validation issues
    
jrockowitz’s picture

Status: Needs review » Fixed
robpowell’s picture

So I am having issues applying the patch. I started from scratch with the new 8.x-1 install. I took a quick look and files the path10 changed and at first determined that the patch with already in the branch. However, when I tested, all select and radio others errored. I took a second look at the source and realized that those hadn't been updated. I did the following to apply the patch:

cd modules/contrib/yamlform
curl -O https://www.drupal.org/files/issues/multistep_validation-2788117-10.patch
patch -p1 --dry-run < multistep_validation-2788117-10.patch

I am a newbie to patching so maybe I have this wrong, but I get some pretty significant errors:

 yamlform git:(feature/update-yamlform) ✗ patch -p1 --dry-run < multistep_validation-2788117-10.patch
patching file src/Element/YamlFormCheckboxesOther.php
Hunk #1 FAILED at 118.
1 out of 1 hunk FAILED -- saving rejects to file src/Element/YamlFormCheckboxesOther.php.rej
patching file src/Element/YamlFormElementOptions.php
Hunk #1 FAILED at 144.
1 out of 1 hunk FAILED -- saving rejects to file src/Element/YamlFormElementOptions.php.rej
patching file src/Element/YamlFormEmailConfirm.php
Hunk #1 FAILED at 111.
1 out of 1 hunk FAILED -- saving rejects to file src/Element/YamlFormEmailConfirm.php.rej
patching file src/Element/YamlFormRadiosOther.php
Hunk #1 FAILED at 109.
1 out of 1 hunk FAILED -- saving rejects to file src/Element/YamlFormRadiosOther.php.rej
patching file src/Element/YamlFormSelectOther.php
Hunk #1 FAILED at 155.
1 out of 1 hunk FAILED -- saving rejects to file src/Element/YamlFormSelectOther.php.rej
patching file src/Tests/YamlFormElementExtrasTest.php
Reversed (or previously applied) patch detected!  Assume -R? [n] 

Am I applying this incorrectly or to the wrong branch? Any help would be appreciated.

jrockowitz’s picture

I applied the patch to the 8.x-1.x. Please test the dev release.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.