I have…
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
I have a schema that contains a field named groups with the array type (localizable).
While retrieving data use GraphQL, this field only has data if X-Languages in the request headers is the master language (en).
If I change the value of X-Languages to another language - French, for instance, the groups field will return an empty array.
For other fields in the schema, the fallback language is working well. But it’s not working with the array type field.
Expected behavior
The fallback language data should work with the array type field.
Minimal reproduction of the problem
Environment
- [ ] Self hosted with docker
- [ ] Self hosted with IIS
- [ ] Self hosted with other version
- [ x ] Cloud version
Version: [VERSION]
Browser:
- [ x ] Chrome (desktop)
- [ ] Chrome (Android)
- [ ] Chrome (iOS)
- [ ] Firefox
- [ ] Safari (desktop)
- [ ] Safari (iOS)
- [ ] IE
- [ ] Edge
Others:
I am not sure what your expectations are.
Generally, the array type field doesn’t return data from the fallback language.
For example, we have 2 languages (English and French), English is the master language. We have an array type field (localizable), we only fulfill data for English and we would like to use it as default for French as well. We don’t want to fulfill data for French, it will double work.
I see…the problem is that fallbacks only work when a field is not there. An empty array is a valid item.
I have to test whether you can clear the field in the UI to make it work.
1 Like
It works as expected.
I have a content item with 2 array fields:
English:
German
As you can see:
- The first clear button is enabled, meaning the value is an empty array.
- The second clear button is disabled, meaning the value is “undefined”.
Therefore you get these results:
2 Likes
Thanks a lot, @Sebastian! It works like a charm. I just wonder why we have to use the clear button instead of setting this feature as default if the array field doesn’t contain any element.
There is only a small issue: when I reload the page or switch between languages, the clear button is not disabled anymore. Is there any way to keep the state of the clear button?
The problem with the clear button is fixed and will be released with the next deployment. I do not want to change the behavior with the array fields for compatibility reasons. The string field also has the same behavior.
1 Like
Sounds good! Thank you so much for supporting me.
1 Like