Problem/Motivation

I followed the instructions for programatically creating a submission, but it doesn't work the way it should. I have a Mollie submit handler with a confirmForm method, but this code is not being executed.

Steps to reproduce

Create a submission by following the instructions, on a webform with a Mollie handler.

Proposed resolution

I was able to find a partial fix: replacing $form_state->setTriggeringElement(['#parents' => []]); with $form_state->setTriggeringElement($form['actions']['submit']) in WebformSubmissionForm::submitWebformSubmission(). This causes a new problem though:

Drupal\Core\Entity\EntityStorageException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'b65b6978-9cd8-4a79-8d85-adb578953a09' for key 'webform_submission.webform_submission_field__uuid__value'

I suspect this happens because for some reason the submission is being saved twice. I'll start a merge request with the WIP fix.

Issue fork webform-3419538

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DieterHolvoet created an issue. See original summary.

DieterHolvoet’s picture

Issue summary: View changes
DieterHolvoet’s picture

Status: Active » Needs work
jrockowitz’s picture

I am not sure we can change the API without tagging a new major version because, for example, other modules/integration would suddenly have the confirmForm method being triggered.

jrockowitz’s picture