Draft documents don't get saved to db when using the autosave option #1031
Replies: 1 comment
-
Hey @ollebergkvist — this is actually working as intended. With Autosave, as soon as you click "create new", a blank document is created because we need the ID to point autosave versions against. As you work, an autosave version will be saved to the With Autosave enabled, there is no way for Payload to know when you are ready to save changes to your "main" document in the main collection. Rather, we just create a blank one, and then store all autosaved changes to the Does this make sense? I'm going to bump this one to a Discussion so we can keep the conversation going. There could be ways to improve this, but at first pass, this is operating as intended. When you click Thoughts? |
Beta Was this translation helpful? Give feedback.
-
Bug Report
When using the autosave option for drafts, field data are not saved to the db.
If you however use the manual save config option (i.e drafts: true), which generates a "save draft" button that the
user manually has to click, data is saved to the db as expected.
Expected Behavior
Draft document fields should be saved to db when autosave is enabled.
Current Behavior
Field values are not saved to the db, empty fields.
https://jmp.sh/b6U7Wz8
Possible Solution
Steps to Reproduce
Detailed Description
System:
OS: macOS 12.5.1
CPU: (6) x64 Intel(R) Core(TM) i5-8500B CPU @ 3.00GHz
Memory: 163.45 MB / 32.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 14.18.3 - ~/.asdf/installs/nodejs/14.18.3/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.14.15 - ~/.asdf/plugins/nodejs/shims/npm
Browsers:
Chrome: 104.0.5112.101
Firefox: 103.0.2
Safari: 15.6.1
Packages:
Payload: ^1.0.27
Beta Was this translation helpful? Give feedback.
All reactions