On some non-node entities like bean and file translatable fields disappear completely from the entity form when I try to edit the respective entity in its default language. Editing the entity in other languages works as expected.

I tracked this down to entity_translation_field_attach_form() being called with the $langcode parameter set to NULL. This causes the $update_langcode being set to TRUE, which means that entity translation will try to localize the form (I think).

Patch coming...

Comments

bforchhammer’s picture

Title: Translatable fields disappear when editing default language » Translatable fields disappear when editing default language (entities other than node)
Status: Active » Needs review
StatusFileSize
new947 bytes

Here we go.

plach’s picture

Issue tags: +Needs tests
StatusFileSize
new787 bytes

Actually when no $langcode is passed to f_a_form() the entity language should be used, see http://drupal.org/node/1626346. Here we use the translation handler which will eventually fall back to the default language.

Does this fix the issue?

bforchhammer’s picture

Status: Needs review » Reviewed & tested by the community

Yes, your patch fixes the problem as well.

plach’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed, thanks!

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

  • Commit 4dcd40a on 7.x-1.x, et-permissions-1829630, factory, et-fc, revisions authored by bforchhammer, committed by plach:
    Issue #1770250 by bforchhammer, plach: Fixed Translatable fields...

  • Commit 4dcd40a on 7.x-1.x, et-permissions-1829630, factory, et-fc, revisions, workbench authored by bforchhammer, committed by plach:
    Issue #1770250 by bforchhammer, plach: Fixed Translatable fields...