mirror of
https://github.com/directus/directus.git
synced 2026-01-29 18:08:04 -05:00
Prevent duplicate field name on recursive m2m
This commit is contained in:
5
.changeset/three-pumas-look.md
Normal file
5
.changeset/three-pumas-look.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@directus/app': patch
|
||||
---
|
||||
|
||||
Prevent duplicate m2o field name on auto-fill recursive m2m
|
||||
@@ -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}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user