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
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:
Comments
Comment #2
DieterHolvoet CreditAttribution: DieterHolvoet at Minsky commentedComment #3
DieterHolvoet CreditAttribution: DieterHolvoet at Minsky commentedComment #4
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedI 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.
Comment #5
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commented