Fix the failing auto-creation of default languages in translation field setup #22409
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Scope
When creating a new translation field and the selected languages collection does not exist the app will create that collection and populate it with some default languages. There is however the edge case that surfaced where the app will try to create items in the non existing collection default collection (
languages
) if the user selects a custom languages collection and does not have the default collection in the data base. This is caused byitems
not properly resetting in thefieldDetailsStore
.To reproduce:
languages
collection in your DBlanguages
/items/languages
in the network panel)What's changed:
state.items
is only utilized in thetranslations.ts
alterations of the field detail store.Potential Risks / Drawbacks
None
Review Notes / Questions
None
Fixes #20510