A plugin to register array fields with a custom input component to store field values in multiple languages, queryable by using the language ID as an array `_key`.
MIT License
45
stars
11
forks
source link
Change in behavior of defaultLanguages starting in Studio 3.57.4 #86
Starting with Sanity Studio 3.57.4, there was a change in behavior to how defaultLanguages is handled within the editor.
3.57.3 and below: whatever language(s) is set as the defaultLanguage in the plugin configuration, could be removed when editing a document in the Studio
3.57.4 and above: the default language could not be removed, even if it was empty
This caused issues with our configuration, as we had a custom object that was configured as an internationalized object, which had a required field. Since we could no longer remove the object, we were unable to publish the document since the required sub-field had to be filled out.
This behavior can be reverted by removing the defaultLanguages key from the plugin configuration.
To Reproduce
Using the following plugin configuration:
Describe the bug
Starting with Sanity Studio 3.57.4, there was a change in behavior to how defaultLanguages is handled within the editor.
This caused issues with our configuration, as we had a custom object that was configured as an internationalized object, which had a required field. Since we could no longer remove the object, we were unable to publish the document since the required sub-field had to be filled out.
This behavior can be reverted by removing the
defaultLanguages
key from the plugin configuration.To Reproduce Using the following plugin configuration:
with a document that has a reference to
internationalizedArrayString
like so:Steps to reproduce the behavior:
en-us
textExpected behavior
I should be able to remove any/all properties of the internationalizedArray
Screenshots 3.57.3 - notice there is no object defined
3.57.4 - notice there is an object defined for
en-us
, however clicking the remove button next to the asset does nothingWhich versions of Sanity are you using?
This is done when updating to 3.57.4 or higher
What operating system are you using?
MacOS 15.1
Which versions of Node.js / npm are you running?
21.5.0