The Form API appears to support validation, see FormBuilder::validateForm. If it's as simple as using that I'm happy to write a MR, but maybe I'm missing something here?
- πΊπΈUnited States jrockowitz Brooklyn, NY
An MR would be welcomed. I am hoping it is a simple one.
- last update
over 1 year ago 531 pass, 4 fail - @gaddman opened merge request.
- Status changed to Needs review
over 1 year ago 10:26pm 7 July 2023 - Merge request !344Issue #3311734: validateWebformSubmission triggers formSubmit on webform handlers β (Open) created by gaddman
- last update
over 1 year ago 531 pass, 4 fail - last update
over 1 year ago 531 pass, 4 fail - Status changed to Active
over 1 year ago 10:56pm 7 July 2023 - πΊπΈUnited States jrockowitz Brooklyn, NY
That is fine. The failing tests hint that this maybe more complex than we initially thought.
- π¨π¦Canada Liam Morland Ontario, CA π¨π¦
Liam Morland β made their first commit to this issueβs fork.
- last update
about 1 year ago 533 pass, 4 fail - Status changed to Needs work
about 1 year ago 9:29pm 5 October 2023 - πΊπΈUnited States jrockowitz Brooklyn, NY
The catch-22 is this is a major change that might have to go into the next major release. Only critical issues will be release blockers.
- π¨π¦Canada Liam Morland Ontario, CA π¨π¦
This line is the problem:
\Drupal::formBuilder()->validateForm($form_id, $form_object, $form_state);
The second parameter to
::validateForm()
needs to be "An associative array containing the structure of the form". The changes in the merge request are instead sending an object of typeWebformSubmissionForm
. - last update
about 1 year ago 533 pass, 4 fail - Status changed to Needs review
about 1 year ago 4:31pm 6 October 2023 - π¨π¦Canada Liam Morland Ontario, CA π¨π¦
Fix for the problem mentioned in #15.
- Status changed to Needs work
about 1 year ago 4:45pm 6 October 2023 - π¨π¦Canada Liam Morland Ontario, CA π¨π¦
This will require a closer look. Not a release blocker; if it is too disruptive of a change, it may need to wait for the next minor release, 6.3.x.