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.

Issue fork webform-3440133

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mattjones86 created an issue. See original summary.

jrockowitz’s picture

Version: 6.2.x-dev » 6.3.x-dev
jrockowitz’s picture

Status: Active » Needs review

The MR is POC. Let's see if any tests break.

liam morland made their first commit to this issue’s fork.

jrockowitz’s picture

Status: Needs review » Reviewed & tested by the community

Moving to RTBC since all the tests should now be passing

liam morland’s picture

Status: Reviewed & tested by the community » Needs work

Tests are not passing.

jrockowitz’s picture

Status: Needs work » Reviewed & tested by the community

I forgot to push a single commit for that one test. I am going to optimistic and move this back to RTBC.

  • jrockowitz committed dba0924f on 6.3.x
    [#3440133] feat: Submissions can be purged immediately after submission...
jrockowitz’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

  • jrockowitz committed dba0924f on 6.x
    [#3440133] feat: Submissions can be purged immediately after submission...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.