Autosave does not begin autosaving until after the user has first done a manual save.

Ouverte
#10,515 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
5/5
Temps estimé
Plus d'une semaine
Accessibilité débutants
25/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
laravel, php
Domaine
backend

Piste de recherche

Start with config/statamic/autosave.php and follow the reproduction steps for a new collection entry, comparing behavior before and after the first manual save. The issue raises unresolved options around required fields, slug creation, and validation, so first determine the intended behavior for unsaved entries. Done means new-entry content is autosaved reliably, or the form clearly tells users they need to save first.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

autosave
Bug description

Autosave does not begin autosaving until after the user has first done a manual save.

Yet many editors will simply create a new entry and start typing, without thinking to do a manual save before they're done — which is kind of the user need for autosave!

So it's important for autosave to either start autosaving straight away, or to clearly inform the user of the need to do a manual save first.

Immediate autosaving approach

The preferred approach would be for autosave to immediately start autosaving, without the need for the user to do the first save manually.

This of course brings some issues:

1. What to do about required system fields, such as Title
Autosave could use a title_format approach until the user has entered a title, such as "Autosaved blog post {hash}'

2. What would happen with the creation of the slug?
Autosave could bypass creation of the slug, leaving that for a manual save

3. What to do about other user-defined required fields
Could autosave bypass validation, that would then only be done on manual saves of the entry?

Inform the user approach

If the above is not possible, or until it can be implemented, the autosave feature could trigger a banner at the top of the entry creation form to say something like:

Activate Autosave
Enter a title (even a placeholder) and click 'Save and continue editing'. After that your content will be autosaved while you work

I understand Autosave is currently experimental, so am opening this issue to contribute to the discussion and refinement. I completely understand if you want to move this discussion somewhere else.

How to reproduce
  1. Enable autosave in config/statamic/autosave.php
  2. Enable autosave on a collection, as described in autosave.php
  3. Create a new entry in that collection. Enter a title, and type in the text field for at least 10 seconds or more to allow for one or two autosaves happening.
  4. Refresh the page.
  5. See that the content has gone, it's not listed anywhere in the collection, and git hasn't identified any file changes
  6. Now repeat the steps, but before refreshing the page click Save once.
  7. Then type some more text for at least 10 seconds to get one or two autosaves happening
  8. Now refresh the page, and see that the text you typed since the manual save has been autosaved.
Logs

No response

Environment
Environment
Application Name: Convivio
Laravel Version: 11.17.0
PHP Version: 8.3.9
Composer Version: 2.7.7
Environment: local
Debug Mode: ENABLED
URL: convivio.test
Maintenance Mode: OFF
Timezone: Europe/London
Locale: en

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: file
Database: sqlite
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Livewire
Livewire: v3.5.4

Statamic
Addons: 11
Sites: 1
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.17.0 PRO

Statamic Addons
goldnead/statamic-toc: 1.5
jonassiewertsen/statamic-livewire: 3.6.0
mitydigital/feedamic: 2.4.1
statamic/wikilinks: 2.1.0
stillat/relationships: 2.2.1
studio1902/statamic-peak-browser-appearance: 3.5.0
studio1902/statamic-peak-commands: 8.4.0
studio1902/statamic-peak-seo: 8.15.3
studio1902/statamic-peak-tools: 6.3.0
tv2regionerne/statamic-passport: 1.4.1
tv2regionerne/statamic-private-api: 1.15.0
Installation

Existing Laravel app

Additional details

No response

Langage dominant
PHP
Étoiles
4.9k
Forks
647
Merge moyen
1 j 45 min
PR mergées (30 j)
221

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de statamic/cms

Toutes les issues de statamic/cms

Issues similaires

Plus d'issues PHP

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.