Active
Project:
Webform Autosave
Version:
2.0.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Oct 2026 at 20:14 UTC
Updated:
22 Oct 2026 at 20:14 UTC
Jump to comment: Most recent
webformautosave_webform_submission_form_alter() saves a new submission as a draft while the form is being built (webformautosave.module:91-95). It does this whenever autosave is enabled, drafts are enabled, and purge is set to draft or all.
Saving an entity inside a form alter means a GET request writes data:
preSave() / postSave() and every hook_webform_submission_insert() runs during the GET, so sites with side effects on save (status tracking, notifications, logs) trigger them just by opening the form.draft_auto_save is on.sid is really needed (for example, for optimistic locking or the autosave button), make early creation an explicit per-webform setting that defaults to off, and don't tie it to the purge setting.$webform_submission->id() is set).Possibly a new per-webform setting, if early creation is kept as an option.
None.
None. Fewer empty draft submissions get created.
Comments