Problem/Motivation

When a webform is set to Inline (reloads the current page and replaces the webform with the confirmation message)
and it is in a reference field submissions are duplicated.

I think each reference layer duplicates the response.
Webform reference on node = 2 emails
Webform reference on paragraph on node = 4 emails

This occurs when Inline (reloads the current page and replaces the webform with the confirmation message) is the confirmation mode. Changing to Message (reloads the current page/form and displays the confirmation message at the top of the page) fixed the issue for us

Steps to reproduce

Modules:

  • webform 6.2.7

Webform configuration
Create webform with 1 field

  • Text field

Change confirmation to Inline (reloads the current page and replaces the webform with the confirmation message)
Add message in Confirmation Message field

Add one handler
Email to the submitter
Default email settings

Content settings
Add webform reference field to basic page
Add basic page and choose the webform you created.

Receive duplicate responses
Submit the form, you will receive multiple responses.
This happens in production and in ddev locally.

Important notes:
If you have a paragraph the duplication is doubled from the reproduction steps.

If you use the test function OR visit the view tab for the form and submit from there you will NOT receive duplicates
Changing the confirmation type from INLINE to Message (reloads the current page/form and displays the confirmation message at the top of the page) also stops sending duplicates.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

nicxvan created an issue. See original summary.

cilefen’s picture

Add the essential steps to build a reproduction.

cilefen’s picture

I saw on Slack that this is a continuation of an older issue.

nicxvan’s picture

Issue summary: View changes
Issue tags: -Needs steps to reproduce

Yeah sorry I created this at the end of my day so I wouldn't forget.

nicxvan’s picture

Issue summary: View changes
cilefen’s picture

Are the webform_protected_downloads and PDF intrinsic to the bug reproduction, or can we leave them out of this?

nicxvan’s picture

Issue summary: View changes

Great point! I just tested with much simpler reproduction steps.

nicxvan’s picture

Issue summary: View changes

Paragraphs is not needed either.

nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Issue summary: View changes

I think each reference layer duplicates the response.

Webform reference on node = 2 emails
Webform reference on paragraph on node = 4 emails

nicxvan’s picture

Issue summary: View changes
nicxvan’s picture

Title: Get multiple duplicate submissions and emails (4x) » Duplicate submissions with inline confirmation and reference fields
Issue summary: View changes
nicxvan’s picture

Issue summary: View changes
lroels’s picture

I can confirm this issue is still happening and also occurs with the "Modal" setting for form confirmation.
The "Message" setting however does not have this issue.

lroels’s picture

Also: I could reproduce this without any handlers added to the form.

kenfordesign’s picture

I can confirm this issue is still happening and also occurs with the "Modal" and "Inline" setting for form confirmation. The "Message" setting does not seem to have this issue.

gaurav.kapoor’s picture

The issue still exists when using a webform as an entity reference field in a paragraph or node. Changing to "Message" from "Confirmation Type" does resolve the issue, but the issue should be fixed for all scenarios.

gaurav.kapoor’s picture

Using AJAX also suppresses the issue, and no multiple submissions in that case as well.

jrockowitz’s picture

Version: 6.2.7 » 6.3.x-dev
StatusFileSize
new5.06 KB

I can't replicate this using the attached webform references by a webform node.

jrockowitz’s picture

Status: Active » Postponed (maintainer needs more info)
StatusFileSize
new50.87 KB

Screen shot

jrockowitz’s picture

StatusFileSize
new3.32 MB
ameymudras’s picture

Thankyou team, for your work on this issue. I encountered a similar problem and, while reviewing this issue, was able to troubleshoot and identify the root cause. In my case, the Toolshed contrib module was responsible. I’ve submitted a patch to address the issue. https://www.drupal.org/project/toolshed/issues/3570032

It could also be caused by a different module conflicting in your case. For troubleshooting, I recommend using hook_form_id_alter() on the specific webform and logging the debug backtrace. I noticed two debug log entries for each webform; by comparing them, I was able to identify the source of the issue.
toolshed

Hope it helps!