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

Fix Save As Copy when duplicating M2M/O2M fields #21896

Merged
merged 4 commits into from Mar 31, 2024

Conversation

joselcvarela
Copy link
Member

Scope

This PR fixes an issue when duplicating an item which has relationships but only the root level field is selected on Item Duplication fields within collection. More can be seen on the linked issue below

What's changed:

  • Fetch all root fields from related collection when saving item as copy

Potential Risks / Drawbacks

  • None as I can think of as current behaviour is currently not working as expected

Review Notes / Questions

  • I was thinking if we could optimize by selecting only the fields we want instead of selecting all of them with * but, since the root field is selected in Item Duplication Fields, I expect that all related fields should be fetched

Fixes #21895

Copy link

changeset-bot bot commented Mar 18, 2024

🦋 Changeset detected

Latest commit: e2685d6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@directus/app Patch
@directus/api Patch
directus Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@paescuj paescuj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with all relationships -> LGTM 🚀

@paescuj paescuj enabled auto-merge (squash) March 31, 2024 17:21
@paescuj paescuj merged commit 19be0ce into directus:main Mar 31, 2024
4 checks passed
@github-actions github-actions bot added this to the Next Release milestone Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Save As Copy does not work when having O2M/M2M relationships
3 participants