Closed (cannot reproduce)
Project:
Internationalization
Version:
7.x-1.4
Component:
Synchronization
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Oct 2011 at 08:35 UTC
Updated:
22 May 2012 at 14:32 UTC
Jump to comment: Most recent file
Comments
Comment #1
torotil commentedNote that field_language() is indeed returning 'und' for those fields. That is because in locale_field_language_fallback (modules/locale/locale.module:479) the field is empty. I'm unsure whether this problem isn't better fixed upstream ("field_language() shouldn't return 'und' for empty image fields").
Comment #2
cyberwolf commentedHaving a similar issue here, not just for image fields, but just any field which is left empty initially. As far as my understanding of the field API goes, I believe field_language() is not intended to be used to retrieve the language to save data in, and should only be used to retrieve the best language the field has values available for, to display them. Attached is a small patch that uses the entity language if the field is translatable, otherwise if the field is not translatable it uses LANGUAGE_NONE.
Comment #3
zilverdistel commentedComment #4
zilverdistel commentedComment #5
jose reyero commentedYes, this makes sense. Committed, thanks.
Comment #7
torotil commentedI've just set-up another site using the 7.x-1.4 and there is still a problem with the approach from above.
I have an image field that is set to be not-translateable but set to synchronize between translations. This leads to the following behavior:
* If I upload the first image in any of the nodes in the translation-set. It doesn't synchronize at all. There is no entry in the field_data_* table for the other nodes.
* If I have one image uploaded and synchronized (manually) and remove it it is also removed in all translations.
* If I modify the line from the patch above to be:
$translation_lang = $entity->language;everything works as expected.Comment #8
torotil commented* Uploading another image (if one is present already) works just fine.
Comment #9
my-family commentedI have (probably) the same problem with Drupal 7.12 and i18n 7.x-1.4. ALL fields, (synchronized or not), have the "und" key in the array structure, although the $node->language is right (cs or en, NEVER undefined).
Thank you in advance for help.
Comment #10
jose reyero commentedFrom #7>
I have an image field that is set to be not-translateable but set to synchronize between translations.
So it looks like you are using entity translation for that content type, right?
If so, the real bug is allowing ET node types to have synchronized fields.
Comment #11
jose reyero commentedComment #12
jose reyero commentedNo follow up, closing.