Submissions can be purged immediately after submission

Created on 11 April 2024, 7 months ago

Problem/Motivation

If these specific purge settings are used, submissions can be purged immediately after submission.

Steps to reproduce

  • Create a webform
  • Enable drafts
  • Enable submission purging of Completed submissions only

Now a user performs this submission flow:

  • Start a submission
  • Saves draft
  • Leaves draft for longer than purge_days value
  • Returns and submits draft

Now the submission is immediately deleted when cron runs. This is because the created column is used when querying submissions to purge.

Proposed resolution

https://git.drupalcode.org/project/webform/-/blob/6.2.x/src/WebformSubmi...

Update the purge logic so that for Completed submissions, the query instead looks at the submitted timestamp. Draft submissions should still query the created timestamp.

🐛 Bug report
Status

Active

Version

6.2

Component

Code

Created by

🇬🇧United Kingdom mattjones86 🇬🇧 GMT+0

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

Comments & Activities

Production build 0.71.5 2024