Add check for a valid webform submission data.

Created on 14 February 2024, 9 months ago
Updated 30 July 2024, 4 months ago

Problem/Motivation

In webform submit resource there is no check for a valid webform submission data i.e. whether provided data elements are in sync with elements provided by the webform. There is possibility to send unrelated data elements and store those to database with the submission.

Steps to reproduce

1) Create a simple webform including only text_field element
2) Enable Webform Submit and access to post on Webform Submit resource
3) Submit data

{
	"webform_id": "test",
	"text_field": "Some text ...",
	"foo": "foo",
	"bar": "bar"
}

4) Check content of webform_submission_data database table

Proposed resolution

Add check for a valid webform submission data to WebformSubmitResource post() method, where submitted data elements are compared to webform elements. If differences, raise "Invalid submission data" -error.

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Needs review

Version

4.1

Component

Code

Created by

๐Ÿ‡ซ๐Ÿ‡ฎFinland mitrpaka

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024