contentful-management.rb icon indicating copy to clipboard operation
contentful-management.rb copied to clipboard

Updating non localized fields is ignored when entry locale is not the default locale

Open HQ063 opened this issue 5 years ago • 0 comments

I have a space with two locales, en-CA and fr-CA. I would expect that if I set a value into a non-localized field, it should always set the value, regarding the current locale. But this is what happens when you try to set a non-localized field using a non-default locale:

[150] pry(main)> entry = content_type.entries.new
=> #<Contentful::Management::DynamicEntry[product]: @sys={:space=>#<Contentful::Management::Link: @sys={:type=>"Link", :linkType=>"Space", :id=>"vyk520m9px5z"}>}>
[151] pry(main)> entry.default_locale
=> "en-CA"
[152] pry(main)> entry.locale = 'fr-CA' # this is the secondary locale for that space
=> "fr-CA"
[153] pry(main)> entry.slug
=> nil
[154] pry(main)> entry.slug = "this-is-a-slug"
=> "this-is-a-slug"
[155] pry(main)> entry.slug
=> nil # This doesn't has any sense...

This issue combined with #204, creates a messy situation that forces us to use a lot of weird workarounds to be able to edit the content in the spaces that are not using the client default locale.

HQ063 avatar Jul 12 '19 00:07 HQ063