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

O2M field does not check if manual primary key (string) already exists #10646

Closed
3 tasks done
HitomiTenshi opened this issue Dec 23, 2021 · 0 comments · Fixed by #12082
Closed
3 tasks done

O2M field does not check if manual primary key (string) already exists #10646

HitomiTenshi opened this issue Dec 23, 2021 · 0 comments · Fixed by #12082

Comments

@HitomiTenshi
Copy link
Contributor

Preflight Checklist

Describe the Bug

This issue is connected to issue #10645 please see the collection setup there, I will use the collections from that issue to demonstrate the next very dangerous bug:

If you add a new key to a keychain but use a name that already exists in the keys collection you will essentially STEAL this key from the keychain it was previously attached to. This can result in field checks breaking if e. g. the field was configured to be required!

To Reproduce

  1. Create a new keychain in the keychains collection.
  2. Add a key that already exists.
  3. You will notice that the bug from issue O2M field that targets a collection with a manual primary key (string) has display issues #10645 did not apply here, since the key was already existing.
  4. If you save now you steal this key from the other keychain.

Video showing the issue (I also reconfigure the field here to be required to show field checks breaking):

2021-12-23_01-21-39.mp4

Errors Shown

N/A

What version of Directus are you using?

9.3.0

What version of Node.js are you using?

16.13.1

What database are you using?

MariaDB 10.3.32

What browser are you using?

Firefox Latest

What operating system are you using?

Windows 10

How are you deploying Directus?

Ubuntu Server 20.04, npm installation with a systemd service running it

@Oreilles Oreilles added this to the Relational Interfaces milestone Feb 11, 2022
@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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants