Given you have an entity reference field that is connected with a translatable vocabulary.
The field use as reference method “Views: Filter by an entity reference view” and a view
like this:
uuid: 1bb5f044-aafe-741e-8fc1-8943801c91d8
langcode: de
status: true
dependencies:
config:
- taxonomy.vocabulary.journeys
module:
- taxonomy
- user
id: referencing_vocabulary
label: 'Referencing vocabulary'
module: views
description: ''
tag: ''
base_table: taxonomy_term_field_data
base_field: tid
core: 8.x
display:
default:
display_plugin: default
id: default
display_title: Master
position: 0
display_options:
access:
type: perm
options:
perm: 'access content'
cache:
type: tag
options: { }
query:
type: views_query
options:
disable_sql_rewrite: false
distinct: false
replica: false
query_comment: ''
query_tags: { }
exposed_form:
type: basic
options:
submit_button: Anwenden
reset_button: false
reset_button_label: Zurücksetzen
exposed_sorts_label: 'Sortieren nach'
expose_sort_order: true
sort_asc_label: Aufsteigend
sort_desc_label: Absteigend
pager:
type: mini
options:
items_per_page: 25
offset: 0
id: 0
total_pages: null
tags:
previous: ‹‹
next: ››
expose:
items_per_page: false
items_per_page_label: 'Elemente pro Seite'
items_per_page_options: '5, 10, 25, 50'
items_per_page_options_all: false
items_per_page_options_all_label: '- Alle -'
offset: false
offset_label: Offset
style:
type: default
options:
grouping: { }
row_class: ''
default_row_class: true
uses_fields: false
row:
type: fields
options:
inline: { }
separator: ''
hide_empty: false
default_field_elements: true
fields:
name:
id: name
table: taxonomy_term_field_data
field: name
entity_type: taxonomy_term
entity_field: name
label: ''
alter:
alter_text: false
make_link: false
absolute: false
trim: false
word_boundary: false
ellipsis: false
strip_tags: false
html: false
hide_empty: false
empty_zero: false
type: string
settings:
link_to_entity: true
plugin_id: term_name
relationship: none
group_type: group
admin_label: ''
exclude: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_alter_empty: true
click_sort_column: value
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
convert_spaces: false
filters:
vid:
id: vid
table: taxonomy_term_field_data
field: vid
value:
journeys: journeys
entity_type: taxonomy_term
entity_field: vid
plugin_id: bundle
sorts: { }
header: { }
footer: { }
empty: { }
relationships: { }
arguments: { }
display_extenders: { }
rendering_language: '***LANGUAGE_language_interface***'
cache_metadata:
max-age: -1
contexts:
- 'languages:language_interface'
- url.query_args
- user.permissions
tags: { }
entity_ref_journeys:
display_plugin: entity_reference
id: entity_ref_journeys
display_title: 'Entity Reference Journeys'
position: 1
display_options:
display_extenders: { }
style:
type: entity_reference
options:
search_fields:
name: name
display_description: ''
defaults:
filters: false
filter_groups: false
filters:
vid:
id: vid
table: taxonomy_term_field_data
field: vid
relationship: none
group_type: group
admin_label: ''
operator: in
value:
journeys: journeys
group: 1
exposed: false
expose:
operator_id: ''
label: ''
description: ''
use_operator: false
operator: ''
identifier: ''
required: false
remember: false
multiple: false
remember_roles:
authenticated: authenticated
reduce: false
is_grouped: false
group_info:
label: ''
description: ''
identifier: ''
optional: true
widget: select
multiple: false
remember: false
default_group: All
default_group_multiple: { }
group_items: { }
entity_type: taxonomy_term
entity_field: vid
plugin_id: bundle
langcode:
id: langcode
table: taxonomy_term_field_data
field: langcode
relationship: none
group_type: group
admin_label: ''
operator: in
value:
'***LANGUAGE_language_interface***': '***LANGUAGE_language_interface***'
group: 1
exposed: false
expose:
operator_id: ''
label: ''
description: ''
use_operator: false
operator: ''
identifier: ''
required: false
remember: false
multiple: false
remember_roles:
authenticated: authenticated
reduce: false
is_grouped: false
group_info:
label: ''
description: ''
identifier: ''
optional: true
widget: select
multiple: false
remember: false
default_group: All
default_group_multiple: { }
group_items: { }
entity_type: taxonomy_term
entity_field: langcode
plugin_id: language
filter_groups:
operator: AND
groups:
1: AND
pager:
type: some
options:
items_per_page: 25
offset: 0
rendering_language: '***LANGUAGE_language_interface***'
cache_metadata:
max-age: -1
contexts:
- 'languages:language_interface'
- user.permissions
tags: { }
Now you set the field formatter to autocomplete.
After that you create a term in the main language and translate it in the second language.
Now you try create a content with the entity reference field in the second language you should get the autocomplete result from the first language. The search and the input works but the labels are in the wrong language.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 2809757_after.png | 250.9 KB | jan.stoeckler |
| #4 | 2809757_before.png | 252.48 KB | jan.stoeckler |
| #3 | Screenshot-9.png | 98.32 KB | lomasr |
| #2 | 2809757-1.patch | 2.48 KB | marvin_b8 |
Comments
Comment #2
marvin_b8 commentedComment #3
lomasr commented"The search and the input works but the labels are in the wrong language".I am not sure about labels. I replicated the issue on my local with steps followed . I am not able to figure out which label needs to be changed in second language. Please see the screenshot.
Comment #4
jan.stoecklerIssue summary could provide a bit more detail & guidance, but from what I can tell, the patch fixes the problem.
Before & after screenshots attached.
Comment #5
amateescu commentedThis will be fixed by #2174633: View output is not used for entityreference options.