I have…
- [X] Read the following guideline: https://docs.squidex.io/01-getting-started/installation/troubleshooting-and-support. I understand that my support request might get deleted if I do not follow the guideline.
- [X] Used code blocks with ``` to format my code examples like JSON or logs properly.
I’m submitting a…
- [ ] Regression (a behavior that stopped working in a new release)
- [X] Bug report
- [ ] Performance issue
- [ ] Documentation issue or request
Current behavior
Create a schema with a regular string field and an array field with a string nested field, both set as localizable. Create a new item in this schema and fill out the string field and add one item to the array under English, and publish.
The data will contain “null” for any other optional languages for the regular string field, but the array field will default as [] instead of null and have no language fallback in the API unless you manually clear the field out for every language or set it to null.
Expected behavior
Array fields should default to “null” instead of an empty array for optional languages to enable API language fallback.
Minimal reproduction of the problem
Schema:
{
"previewUrls": {},
"properties": {
"validateOnPublish": false
},
"scripts": {},
"isPublished": true,
"fieldRules": [],
"fieldsInLists": [],
"fieldsInReferences": [],
"fields": [
{
"name": "localstring",
"properties": {
"isRequired": false,
"isRequiredOnPublish": false,
"isHalfWidth": false,
"fieldType": "String",
"createEnum": false,
"editor": "Input",
"inlineEditable": false,
"isEmbeddable": false,
"isUnique": false,
"contentType": "Unspecified",
"label": "Local String"
},
"isLocked": false,
"isHidden": false,
"isDisabled": false,
"partitioning": "language"
},
{
"name": "localarray",
"properties": {
"isRequired": false,
"isRequiredOnPublish": false,
"isHalfWidth": false,
"fieldType": "Array",
"label": "Local Array"
},
"isLocked": false,
"isHidden": false,
"isDisabled": false,
"partitioning": "language",
"nested": [
{
"name": "label",
"properties": {
"isRequired": false,
"isRequiredOnPublish": false,
"isHalfWidth": false,
"fieldType": "String",
"createEnum": false,
"editor": "Input",
"inlineEditable": false,
"isEmbeddable": false,
"isUnique": false,
"contentType": "Unspecified"
},
"isLocked": false,
"isHidden": false,
"isDisabled": false
}
]
}
],
"type": "Default"
}
Example item I created
{
"localstring": {
"en": "Test",
"en-AW": null,
"en-BM": null,
"en-HT": null,
"en-JM": null
},
"localarray": {
"en": [
{
"label": "test"
}
],
"en-AW": [],
"en-BM": [],
"en-HT": [],
"en-JM": []
}
}
Environment
App Name:
- [X] Self hosted with docker
- [ ] Self hosted with IIS
- [ ] Self hosted with other version
- [ ] Cloud version
Version: [VERSION]
Browser:
- [X] Chrome (desktop)
- [ ] Chrome (Android)
- [ ] Chrome (iOS)
- [ ] Firefox
- [ ] Safari (desktop)
- [ ] Safari (iOS)
- [ ] IE
- [ ] Edge
Others: