Skip to content
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

One to many: Create new fails if related many to one is required #15062

Closed
Dominic-Marcelino opened this issue Aug 14, 2022 · 4 comments
Closed

Comments

@Dominic-Marcelino
Copy link
Contributor

Describe the Bug

Let's create a "parent" and a "child" collection.
The child collection get's a many-to-one relation to the parent and the parent a related one-to-many alias.

When we try to create new child items from the parent's object, the childs "parent" field is always disabled in the drawer.
On creating the item it get's automatically set to the current opened parent (everything as expected).

But once we make the parent-id field required on the child we can't create any child-items from the parent anymore. The app prevents this, as there's no parent selected.

To Reproduce

@ see above

1.) Create child and parent collection
2.) Create many-to-one relation on child to parent & corresponding one-to-many alias
3.) Create a parent object and try to create a child --> everything works as expected
4.) Set the parent_id on the child as required
5.) Re-try to create a child from the parent and it fails

Errors Shown

the parent.id field is required

What version of Directus are you using?

9.15.1

What version of Node.js are you using?

N/A

What database are you using?

MySQL

What browser are you using?

Chrome

How are you deploying Directus?

N/A

@azrikahar
Copy link
Contributor

Duplicate of #15043 #15012 #14992. It has since been resolved by #14996 and will be included in the next release.

@azrikahar azrikahar closed this as not planned Won't fix, can't repro, duplicate, stale Aug 14, 2022
@drnachio
Copy link

drnachio commented Aug 19, 2022

It is failing again in v9.16.1, I've been waiting 2 week to be able to create O2M records.

@rijkvanzanten
Copy link
Member

@drnachio please don't cross post the same message on duplicates.

@drnachio
Copy link

Sorry

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants