New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Directus recreate an entry when updating a relationship #13042
Comments
Can you try updating to the latest version of Directus? I'm fairly sure this was fixed in #12840. We can reopen if it doesn't work in the latest version 👍🏻 |
I updated Directus but still the error. Is there any particular manipulation to do other than changing the version of Directus? |
Would you be able to share a database dump of a minimal reproduction? I have some trouble reproducing the setup based on the image and description alone (the exact relational configuration matters a lot here 🙂 ) |
I can only retrieve the entire database. Where can I send it to you? |
@rijkvanzanten I made a directus test website. https://directustest.slatsh.com/ with defaut admin account. Is it okay for you to try ? (I looked and the error is still there) |
directustest.zip |
This is happening because the o2m interface is not properly sending id's of relations on the junction table. |
issue #12881 looks like the original marking this as duplicate |
Describe the Bug
I have a little problem with the way Directus works.
To make it simple I'll explain:
I have a data model of recipes. In this one, I put an one to many to a data model that will act as a join. It will group the ingredients with their quantity and the unit (L, kg, ...) in the said recipe. (You can see the image)
When I add an ingredient and select it, everything is fine. The problem comes when I reopen a recipe with ingredients and I want to change the name of the ingredient or any other information. It will, instead of just changing the entry, recreate an ingredient. As I have put that the ingredients must be unique, I can't modify them in the recipes. I can only add them and once validated, it's over.
Do you know if I made a mistake with the relations or is it a problem in Directus?
To Reproduce
Errors Shown
No response
What version of Directus are you using?
9.9.0
What version of Node.js are you using?
16.14.2
What database are you using?
Postgre
What browser are you using?
Chrome
How are you deploying Directus?
Docker
The text was updated successfully, but these errors were encountered: