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
purgeisnone, it is changed todraft(orallwhen it wascompleted). - If
purge_daysis empty, it is set to 182. - If
draftisnone, it is changed toall. - With optimistic locking,
submission_logis 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
purgeandpurge_daysautomatically. Recommend purging in the settings description, or show a warning in the third-party settings form when purge is off. - Keep auto-enabling
draftandsubmission_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.
Issue fork webformautosave-3632550
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
Comment #2
rymcveighComment #4
rymcveighComment #5
rymcveighComment #7
rymcveigh