-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fields_for_query has buggy order-dependent logic #70
Comments
@grncdr after several tests, I cannot find any unexpected behaviour related to the pointed out method or any Tests done:On a Space with 2 locales with 1 content type, with fields
All of these were the expected results. Closing, until more information is provided |
Hey, @dlitvakb, all tests above are correct, but what we are getting from API is: {
"fields": {
"nameIntern": {
"no-NO": "Animal School Day",
"dk-DK": "Animal School Day",
"pl-PL": "Animal School Day",
"en-US": "Animal School Day",
"de-DE": "Ein tierischer Schultag",
"de-AT": "Ein tierischer Schultag",
"de-CH": "Ein tierischer Schultag",
"se-SE": "Animal School Day",
"nl-BE": "Dierenschooldag",
"nl-NL": "Dierenschooldag"
},
"iOsPhoneId": {
"en-US": "588812258"
},
"iOsTabletId": {
"en-US": "588813273"
}
} Because of wrong order of locales in fields ( other entries always have entry.i_os_phone_id // "588812258"
entry.i_os_phone_id_with_locales // nil Problem is in https://github.com/contentful/contentful-management.rb/blob/master/lib/contentful/management/entry.rb#L195, where is assume that default locale in My {
"no-NO" => {
"nameIntern" => "Animal School Day"
},
"en-US" => {
"nameIntern" => "Animal School Day",
"iOsPhoneId" => "...",
"iOsTabletId" => "..."
}
} |
@lluzak Oh, the issue makes sense now. Have actually no idea how to generate it so that the default locale is not the first place, but, I got to fix the issue by merging whatever is there from any locale. PR soon |
This comes from ZenDesk, and appears to be a bug on this line.
If the first
(locale, fields)
tuple inraw_fields
does not contain every field name, then the result offields_for_query
can entirely skip fields that do have defined values in other locales.The text was updated successfully, but these errors were encountered: