Prevent duplicate field name on recursive m2m

This commit is contained in:
rijkvanzanten
2021-05-24 13:20:01 -04:00
parent c0182d7b14
commit bd6cab8989
2 changed files with 9 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
'@directus/app': patch
---
Prevent duplicate m2o field name on auto-fill recursive m2m

View File

@@ -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}`;
}
}
}