- [ ] Checked the logs and have uploaded a log file and provided a link because I found something suspicious there. Please do not post the log file in the topic because very often something important is missing.
I’m submitting a…
- [ ] Regression (a behavior that stopped working in a new release)
- [x] Bug report
- [ ] Performance issue
- [ ] Documentation issue or request
If one defines language fallbacks for localizable arrays they are not applied - instead the array is returned empty.
Language fallbacks are applied properly for arrays as well. I guess that the issue is likely caused by squidex not being able to know whether an array is unset or just empty. So in the end the issue (and maybe the solution as well?) could be similar to [SOLVED] Assets don't use language fallbacks. Unset should be the default. Squidex could alternatively also use the minItems validation value as an indicator for the default value. In our case we set it to 1 which was then violated by the empty array response without any warning.
Minimal reproduction of the problem
- Define an array in a schema and make it localizable. Optionally set the minimum item count to 1 in the validation tab of the the array property.
- Define two languages A and B. Make A the fallback for B.
- Define entries for the array in the fallback language A.
- Don’t define entries for the array in the second language B.
- Make a request and set the language headers, so that they target language B. You’ll get an empty array, and not the contents defined for fallback language A.
- [ ] Self hosted with docker
- [ ] Self hosted with IIS
- [ ] Self hosted with other version
- [x] Cloud version
Version: latest Cloud version
- [ ] Chrome (desktop)
- [ ] Chrome (Android)
- [ ] Chrome (iOS)
- [ ] Firefox
- [ ] Safari (desktop)
- [ ] Safari (iOS)
- [ ] IE
- [ ] Edge
I can DM requests and responses as needed.