Problem/Motivation

webformautosave_webform_presave() (webformautosave.module:208) silently changes a webform's settings every time it is saved with autosave or optimistic locking enabled:

  • If purge is none, it is changed to draft (or all when it was completed).
  • If purge_days is empty, it is set to 182.
  • If draft is none, it is changed to all.
  • With optimistic locking, submission_log is turned on.

Enabling submission_log and drafts is reasonable, since the features need them. Automatically enabling purge means that turning on autosave also schedules deletion of submission data. That can surprise site builders, and for sites with retention requirements (research, legal, health data), a module enabling data deletion without being asked is risky. The change is also invisible: no message is shown, and it reapplies on every save, so a builder can't opt out of purging while keeping autosave.

Proposed resolution

  • Stop changing purge and purge_days automatically. Recommend purging in the settings description, or show a warning in the third-party settings form when purge is off.
  • Keep auto-enabling draft and submission_log, but show a messenger notice when they are changed.
  • Decouple the early-draft behavior (see the "initial draft is saved during GET" issue) from the purge setting.

Remaining tasks

  • Agree on the behavior, then write the MR.
  • Add a release note: existing webforms keep whatever purge settings they already have, and nothing changes them retroactively.

User interface changes

A warning or notice in the webform third-party settings form.

API changes

None.

Data model changes

None. Webform config is no longer changed automatically on save.

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

rymcveigh created an issue. See original summary.

rymcveigh’s picture

Version: 2.0.x-dev » 2.1.x-dev

rymcveigh’s picture

Status: Active » Needs review
rymcveigh’s picture

Status: Needs review » Reviewed & tested by the community

  • rymcveigh committed 1e1aabea on 2.1.x
    fix: #3632550 hook_webform_presave() silently enables draft purging and...
rymcveigh’s picture

Status: Reviewed & tested by the community » Fixed

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

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

Maintainers, credit people who helped resolve this issue.