Webform referenced and rendered in paragraph will store submissions in paragraph and breaks drafts

Created on 27 August 2021, over 3 years ago
Updated 28 May 2023, almost 2 years ago

Problem/Motivation

When referencing a webform from a field in a paragraph and rendering as such, the submissions will have the `entity_type` and `entity_id` of the parenting paragraph. I'm not entirely sure if this should be the case, though I do know that it breaks drafts. Also, I noted that there is already traversal in place on /src/WebformSubmissionForm.php:307 which attempts to replace the entity to a paragraph's parenting entity. So I think it might make sense to save them with that parent?

Steps to reproduce

Create webform with some random fields, with draft capability.
Create paragraph and add webform reference field in paragraph.
Create node with paragraph and reference the created webform.
Go to node, fill in some values for the submission and save the draft.
Refresh to check if the draft has persisted and note that it is not being loaded.

Proposed resolution

I'll be attaching a patch which attempts to fix.

Remaining tasks

Review and check from maintainers if this is the right solution.

User interface changes

N/a

API changes

N/a

Data model changes

N/a

πŸ› Bug report
Status

Needs review

Version

6.1

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands aken.niels@gmail.com

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024