webform submission update gets triggered on load when using webform's render element

Created on 24 July 2024, 4 months ago
Updated 25 July 2024, 4 months ago

Problem/Motivation

When loading a webform submission by a webform render element to edit, it gets updated immediately on load and on every ajax request.

Steps to reproduce

1. Create a webform
2. Make a submission (insert)
3. Create a route that returns a render array with the webform render element and the submission for edit


// Snippet
$build[] = ['#type' => 'webform', '#webform' => $webform->id(), '#sid' => $submission->id()];

//Full render array
$render = [
            '#theme' => 'container',
            '#children' => [$build],
            '#cache' => ['max-age' => 0],
];

4. Turn on submission logs and watch the "submission updated" operation get triggered along any associated email / handler on initial page load and on any subsequent #ajax request defined on the form elements, no submit button pressed.

This behavior doesn't occur when editing the submission through webform's administration UI.

🐛 Bug report
Status

Closed: works as designed

Version

6.2

Component

Code

Created by

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

Comments & Activities

Production build 0.71.5 2024