Skip to content

Commit

Permalink
Prevent duplicate field name on recursive m2m
Browse files Browse the repository at this point in the history
  • Loading branch information
rijkvanzanten committed May 24, 2021
1 parent c0182d7 commit bd6cab8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/three-pumas-look.md
@@ -0,0 +1,5 @@
---
'@directus/app': patch
---

Prevent duplicate m2o field name on auto-fill recursive m2m
Expand Up @@ -775,6 +775,10 @@ function initLocalStore(collection: string, field: string, type: typeof localTyp

state.relations[0].field = `${collection}_${currentPKField}`;
state.relations[1].field = `${relatedCollection}_${relatedPKField}`;

if (state.relations[0].field === state.relations[1].field) {
state.relations[1].field = `related_${state.relations[1].field}`;
}
}
}

Expand Down

0 comments on commit bd6cab8

Please sign in to comment.