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 the failing auto-creation of default languages in translation field setup #22409

Merged
merged 4 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/curvy-houses-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---

Check warning on line 1 in .changeset/curvy-houses-grin.md

View workflow job for this annotation

GitHub Actions / Lint

File ignored by default.
'@directus/app': patch
---

Fixed the failing auto-creating of default languages for custom languages collections in the translation field setup
hanneskuettner marked this conversation as resolved.
Show resolved Hide resolved
hanneskuettner marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export const useFieldDetailStore = defineStore({
alterations[localType].applyChanges(updates, state, { hasChanged, getCurrent });
}

const { field: fieldUpdates, ...restUpdates } = updates;
const { field: fieldUpdates, items: itemUpdates, ...restUpdates } = updates;

mergeWith(state, restUpdates, (_, srcValue, key, object) => {
if (Array.isArray(srcValue)) return srcValue;
Expand All @@ -189,6 +189,10 @@ export const useFieldDetailStore = defineStore({
Object.assign((state.fieldUpdates.meta ??= {}), metaUpdates);
}
}

if (itemUpdates) {
state.items = itemUpdates as (typeof this.$state)['items'];
}
});
},
async save() {
Expand Down