I have a collection of posts that have a collection of categories associated with it. When I select the category and click save, the post is saved successfully, but the selected category is not shown in the select. In order for me to see the category I need to reload the page. If I don't reload the page, make any changes to the post and save again I get an error: "The following field is invalid: category". Is this a bug or am I doing something wrong?
Thank you very much!
I just noticed that this problem only occurs when hasMany is set to true!!!
hey @.gustavocardoso, I tried to recreate your issue but am not seeing the same thing. There might be an issue with the way you have set it up. Can you share your Category collection config here so I can see if I spot any problems?
This is my Posts collection
This is the categories collection
Thanks for your time!
@.gustavocardoso everything here looks correct to me. What version of Payload are you running? I know there have been a couple patch releases related to relationships, perhaps this issue was one of them
I'm using version 1.15.4
This was indeed a bug, and was patched in 1.15.5. Upgrading to 1.15.5 or later will solve your issue 👍
Everithung is working fine now! Thank you bro. I owe you a beer! 😉
Glad I could help! cheers 🍻