#Enabling drafts after collection has items causes items to not show on admin panel
9 messages · Page 1 of 1 (latest)
Help is on the way! To mark it as solved, use the /solve command. In the meantime, here are some existing threads that may help you:
Documentation:
Community-Help:
- Collection item deleted manually from Mongodb VSC extension, but it's still in the admin dashboard.
- LivePreview not updating in Next.js App Router?
- [The following path cannot be queried: status","data":[{"path":"status"}]}]](https://payloadcms.com/community-help/discord/the-following-path-cannot-be-queried-status-data-path-status)
- duplicate page not working
you need to resave the items
How can I do that if they arent showing up?
add this to onInit in your payload config file: onInit: async (payload) => { await payload.update({ collection: 'pages', // your collection slug goes here where: {}, data: {_status: 'published'} }) }
after that, you can remove it from your onInit or comment it out. this will update all your collection items to have the new _status field populated, which will make them show up again in your list view
@ancient pivot thanks a ton! You rock!
(also, maybe payload should handle this internally?)
With mongodb its not good idea to handle internally. With sql database it is handled by migrations.
I created a script that resaves any collection.
Here is a link:
https://github.com/payloadcms/payload/discussions/434#discussioncomment-12711086
Hope it can help in future for other issues too.