Problem/Motivation

When you change the language of a node while creating or editing them this module doesn't automatically change the Entity Reference (ER) field options to match parent's language. So If you are creating a node with the interface in English and you select the node to be in Spanish, the ER field options won't save properly.

Proposed resolution

I programmed a small module to fix this on Github: https://github.com/rogercodina/translated_entityreference_parent However, notice this module is only suited when users choose all their ER fields to match parent's language. . This is why I submit a patch for this module that includes my module on Github as a submodule of "Translated Entity Reference": my fix checks out all ER options selected by user and replaces it by the same option but in parent's language. Like "Translated Entity Reference" module, it works with fields that reference nodes and taxonomy terms.

It is highly recommended to also apply patch of issue 2764093.

Remaining tasks

None.

Comments

rcodina created an issue. See original summary.

rcodina’s picture

StatusFileSize
new1.39 KB

I enclose a patch that includes all what my module does in yours.

rcodina’s picture

Issue summary: View changes
rcodina’s picture

Issue summary: View changes
rcodina’s picture

StatusFileSize
new2.06 KB

Added support for taxonomies.

rcodina’s picture

Issue summary: View changes
Status: Active » Needs review
rcodina’s picture

Issue summary: View changes
rcodina’s picture

Issue summary: View changes
Status: Needs review » Needs work
rcodina’s picture

Issue summary: View changes
rcodina’s picture

StatusFileSize
new3.83 KB
rcodina’s picture

Issue summary: View changes
Status: Needs work » Needs review
rcodina’s picture

Issue summary: View changes
Giuliano82’s picture

I don't know if my problem is related to this, but i have an italian Content Type called 'Performance' that has got reference to another one called 'Place'. When i click on Translate on a Performance node, with Translated entity reference module installed, i see correctly the English Places nodes(i created their translations)only, but they are not selected! That's because Content translation copies each field of the orginal node to the new translated node, so the translation page is working with original nid and not using the tnid!
I tried this patch but it doens't affect me in any way...i just copied your functions in the module.

Giuliano82’s picture

Ok, i solved my problem with a sandbox module. I found my solution on this post:
http://drupal.stackexchange.com/questions/74355/translated-node-does-not...

rcodina’s picture

@Giuliano82 You have to use the patch in current issue in combination with this another one: https://www.drupal.org/node/2764093 Moreover, I recommend to use my module on github instead of the patch in current issue because my patch does make sense only for users who want their ER fields to be guided by parent's language. The patch on issue 2764093 could be applied to module with no problem.

rcodina’s picture

rcodina’s picture

Issue summary: View changes
rcodina’s picture

Issue summary: View changes
rcodina’s picture

Priority: Normal » Critical
StatusFileSize
new4.45 KB
rcodina’s picture

Issue summary: View changes
rcodina’s picture

@Giuliano82 Download latest dev version and use module_s_entity-2764093-15.patch, edit_when_user_changes-2762971-19.patch and module_not_working-2267853-7.patch patches. Remember to enable the submodule!

Given I see you are a new user here you will find information on how to apply patches. I just usually copy patches inside module folder and then use command:

patch -p1 < NAME_OF_PATCH

rcodina’s picture