Issue with custom webform handler

Created on 22 May 2024, 12 months ago

I have a custom webform handler that populates other webform elements then saves the webform submission all within the submitForm method. This works fine for a webform that was submitted.

However, when using the REST based webform submission for a new submission, if I try to save the submission within this method, I get a MySQL error like this:
Integrity constraint violation: 1062 Duplicate entry '1a697ccf-c618-46f4-b6b5-e755cc616ff6' for key 'webform_submission_field__uuid__value

If I remove the save operation, then my populated elements do not get persisted even when updating all of them via
$webform_submission->setData($values);

I'm starting to think that I may be doing this submission updating work in the wrong place since I would think that the webform custom handler should work for REST as well as regular webforms.

Please help.

Thank you :)

💬 Support request
Status

Active

Version

4.1

Component

Code

Created by

🇺🇸United States davemaxg

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @davemaxg
  • 🇮🇳India vikas shishodia

    Hi @davemaxg

    I am also facing the similar issue. I want to update one of the existing field value on form submit via post request in my custom form handler and it is not updating.

    Did you find any solution for this?

Production build 0.71.5 2024