This is a follow-up to #1344672: Field Collection: Field translation (entity_translation) support., which I am documenting as best as I can, but there is a workaround (explained below), so I am unlikely to be able to follow up further on this too much.

If a field collection field within a field collection (i.e. a nested field collection) is translatable with entity translation, translation does not work correctly.

For example, with the following fields set up:

node (translatable with ET) -> translatable field collection field -> translatable field collection field -> translatable field(s)
Both field collections at each level also contain other translatable fields of other types.
Nodes, but not field collections, are set as translatable in the ET settings at /admin/config/regional/entity_translation (maybe that's the problem, though in that case, it should be clear somewhere in the UI that that is an impossible combination of settings?? I haven't checked that.)

...First create the node, in a language (i.e. not Language neutral), entering values at all levels and this saves fine. But then go back in and edit the node - the values are not there. If you then re-add the values and save the node then go back to edit it it retains the data this time. Potentially that's because the first time around, values are being saved as language neutral, but then on editing the node, the values are trying to be retrieved from the node language instead?

I imagine there are other combinations of un/translatable fields at different levels, for example, I couldn't get it to work with only the 'deepest' level of field being translatable either.

WORKAROUND: The only reliable way I could set up my fields was to have the node and just the top-level field collection field as translatable.

Edit: Changed from bug to task to improve the documentation since the module is working as designed.

CommentFileSizeAuthor
#5 entity_translation-2785573-5.patch961 bytesbramdriesen

Comments

james.williams created an issue. See original summary.

riddhi.addweb’s picture

aspilicious’s picture

I think your "workaround" is just how it is supposed to work...

james.williams’s picture

@aspilicious if that is the case, at the very least, it needs to be documented somewhere, or preferably, shown in the UI on the node edit page or settings form. This is the bit that will not match user expectations:

First create the node, in a language (i.e. not Language neutral), entering values at all levels and this saves fine. But then go back in and edit the node - the values are not there.

I don't think it's fair for that behaviour to remain unless the user is given feedback about it. Better yet, the user should not need to experience this, either because combinations of settings should not be made possible, or ideally (but harder to implement!), the combination of settings could be supported.

bramdriesen’s picture

Title: Entity translation support for nested field collections » Document entity translation for nested field collections
Category: Bug report » Task
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new961 bytes

Turns out it is working out of the box, I was also struggling with this so I updated the readme file with useful documentation about the steps needed to make entity translation work for field collections. Patch attached and ready for review.

renatog’s picture

Status: Needs review » Reviewed & tested by the community

Hello Bram!

Checked and text are useful.

+RTBC

  • RenatoG committed 632e013 on 7.x-1.x authored by BramDriesen
    Issue #2785573 by BramDriesen, james.williams, riddhi.addweb,...
renatog’s picture

Status: Reviewed & tested by the community » Fixed

Committed to the dev branch.

Thank you very much.

Best,

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.