#Phantom item in collection

13 messages · Page 1 of 1 (latest)

copper swallow
#

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

atomic gorge
#

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.

slender rune
#

@atomic gorge that is interesting I am going to try and replicate this.

@copper swallow do your remember how the original item (the one that has a phantom copy now) was created? i.e. through createNew on your collection, or through a relationship or post req

@craggy maple sounds possibly related to your issue fyi

copper swallow
#

No, not sure about how it was created. Been few months since then. Probably from its collection.

atomic gorge
slender rune
#

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 unique: true the category name field which would stop you on the second save.

copper swallow
#

So how can I remove it without editing database?

slender rune
#

@copper swallow 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?

copper swallow
#

Only not found message

slender rune
#

And does it appear in the database?

copper swallow
#

In main collection - no. In _versions - there is one item that refers to its id as parent

slender rune
#

@copper swallow are you still experiencing this issue on payload@latest?