This project is not covered by Drupal’s security advisory policy.

The "Autosave Form" module provides an autosave feature for all forms (entity forms inclusive). Drupal Core >= 8.3.x is required.

Currently the autosave submit will be triggered every 60 seconds, but this approach might be exchanged later through a solution listening for DOM changes.

The autosave form module comes with a configuration form, which could be found under Admin->Configuration->Content->Autosave Form. There the interval could be easily adjusted and decide whether autosave is turned on for content or config entity forms or for both. By default it is active only on content entity forms and currently it is being tested only with content entity forms. If support for config entity forms is required please feel free to open an issue if you find some bugs regarding config entity forms.

At the moment the autosave works only for entity forms, but it will be extended to cover regular forms as well.

As there is no conflict management solution implemented yet, the autosaved states for an entity will be purged when the entity is saved - as soon as the conflict management solution is present this behavior will be changed. If a user is currently editing an entity form and it is already cached by e.g. ajax call for adding a new item to a multiple field, and it is being saved by another user, then an alert message will be shown indicating that the autosave has been turned off, because the entity has been saved elsewhere.

When the user opens a form, she was previously editing and an autosaved state is present she will see a message indicating that there is an autosaved state and will be offered the ability to resume the editing or discard the autosaved states. A third option "view differences" will be implemented later.

The module works out of the box for normal content entity forms, but if you have nested entity reference inline forms then you would require entity deep serialization. For that please take a look at the following Drupal Core issues
#2824097: Deep serialization for content entities to make an exact snapshot of an entity object's structure based on its current state
and
#2844229: Serializing content entity form objects should deeply serialize the entity in case of nested/inline entity forms.

AttachmentSize
autosave_form_message.png70.22 KB

Project Information

Downloads