Problem/Motivation
Entity Reference fields aren't aware of content translation. Steps to reproduce on a brand new drupal:
1) I create a new Entity Reference field named "Articles" on "Basic page" that references "Articles" with widget "select list". Unlimited values.
2) I enable "Content translation" module
3) I edit "Article" and "Basic page" content types to enable "Multilingual support" with option "Enabled, with translation" (both content types)
4) I enable Spanish language on admin/config/regional/language
5) I create a new Article named "Article EN" with language English selected
6) I create a new Article named "Article ES" with language Spanish selected
7) I create a new Basic page named "Basic page ES" with language Spanish selected. I see both "Article EN" and "Article ES" on "Articles" Entity Reference field => I consider this is correct because the node is not yet saved. However, something could be done with AJAX to filter options once language select changes.
8) Now I edit the recently created "Basic page ES" and I can still see "Article EN" => I consider this is wrong because "Basic page ES" has Spanish language selected.
Proposed resolution
a) Filter selectable options according to node's language.
b) If we are creating a new node, when users selects an specific language, selectable options should be filtered according to language selector.
Comments
Comment #2
rcodinaComment #3
rcodinaI think I found a solution on related issue.
Comment #4
rcodinaThe solutions consists in using module Translated Entity Reference with following patches:
#2762971: When user changes the node language while creating or editing, Entity Reference field options don't change
#2764093: Module's entity handlers for Entity Reference fields that points to nodes and terms are wrong
#2267853: Module not working after update
module_s_entity-2764093-15.patch
edit_when_user_changes-2762971-19.patch
module_not_working-2267853-8.patch