I have phantom item in one of collections. It appears to be independent item, while being duplicate of another existing item. But clicking on it returns only error "not found".
How did it happen? How can I fix it?
To fix - I mean without manually deleting it from database
Do you mean to fix the course of why ghost duplication happens?
There is a bug when editing collections through the relationship popups; if you save the collection more than once, it creates a duplicate.
@Martin R that is interesting I am going to try and replicate this.
@Arctomachine do your remember how the original item (the one that has a phantom copy now) was created? i.e. through
on your collection, or through a relationship or post req
@johnmadrigal_ sounds possibly related to your issue fyi
No, not sure about how it was created. Been few months since then. Probably from its collection.
1. Login tohttps://demo.payloadcms.com/admin
2. Navigate to posts
3. Create a new category by clicking on the +
4. Fill out the Name
5. Click Save
6 .Click Save
7. Click Save
8. Click Save
9. Navigate to Categories
10. Fix the bug 🙂
That behavior is not necessarily a bug, you should be allowed to create multiple documents from the drawer if you need - but you can definitely opt to prevent this behavior, in the demo for example you could add
the category name field which would stop you on the second save.
So how can I remove it without editing database?
@Arctomachine sorry the response above was to the scenario Martin described. Your issue is slightly different and I have still not been able to replicate. If you go to the endpoint for that doc in your browser (…/api/[collection]/[id]) - what does that show?
Only not found message
And does it appear in the database?
In main collection - no. In _versions - there is one item that refers to its id as parent
@Arctomachine are you still experiencing this issue on payload@latest?
No. I ran migration script that I found in one of patchnotes, it seems to have fixed it