Closed
Description
Describe the Bug
When i enabled orderable on collection with existing data and versions enabled , after trying to reorder , i get this error:
Details:
After , i reloaded page and tried to order collection again ,it worked mostly without error , order was changed after few tries. After reloading again , all data in reordered document is gone.
on my test repo , it doesn't matter if changes are published or not , all data gone ( new version in drafts with all fields empty).
Link to the code that reproduces this issue
https://github.com/VeiaG/orderable-data-bug
Reproduction Steps
pnpm dev _community
- Add versions and access to collection ( access function from docs )
versions: {
maxPerDoc: 5,
drafts: true,
},
// orderable: true,
access: {
read: ({ req }) => {
if (req.user) {
return true
}
return {
or: [
{
_status: {
equals: 'published',
},
},
{
_status: {
exists: false,
},
},
],
}
},
},
- Add some data to collection
- Enable
orderable
, and try to order things - After successful reordering , refresh page to see that all data is gone.
Which area(s) are affected? (Select all that apply)
area: core
Environment Info
Payload: last from `main`
Next.js: same
Node.js: v20.18.0