Setup:
- enable language module,
- enable "German" language in addition to "English"
- visit admin/config/regional/content-language and enable "Show language selector on create and edit pages" for nodes
- visit admin/structure/types/manage/article/display and make the "Language" field visible

Then:
- Add an article node, select "German" for the node language, submit
- The node view page shows "Language: English" :-)

Comments

yched’s picture

Status: Active » Needs review
Issue tags: +Needs tests
StatusFileSize
new707 bytes

Patch - help welcome for the test ;-)

yched’s picture

StatusFileSize
new694 bytes

Er, we can be a bit smarter...

The last submitted patch, 1: node_language_view-2161177-1.patch, failed testing.

gábor hojtsy’s picture

Issue tags: +D8MI, +language-content

So where is that $langcode coming there (incorrectly)?

yched’s picture

So where is that $langcode coming there (incorrectly)?

It's the language in which the entity_view($entity, $view_mode, $langcode) has been requested - here English, since my default UI language is still English.

There's an existing issue about what to do with all those $langcode params down the entity_view() callstack, now that we have the new Entity Translation model...

xjm’s picture

Component: node.module » node system

(Merging "node system" and "node.module" components for 8.x; disregard.)

xjm’s picture

Component: node.module » node system

(Merging "node system" and "node.module" components for 8.x; disregard.)

xjm’s picture

(Merging "node system" and "node.module" components for 8.x; disregard.)

gábor hojtsy’s picture

Thanks! Ok, then only needs tests now :)

plopesc’s picture

Re-rolling and adding test.

Regards.

Status: Needs review » Needs work

The last submitted patch, 10: node_language_view-2161177-10.patch, failed testing.

The last submitted patch, 10: node_language_view-2161177-10-test-only.patch, failed testing.

plopesc’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 10: node_language_view-2161177-10.patch, failed testing.

The last submitted patch, 10: node_language_view-2161177-10.patch, failed testing.

plopesc’s picture

Status: Needs work » Needs review
swentel’s picture

+++ b/core/modules/node/lib/Drupal/node/Tests/NodeViewLanguageTest.php
@@ -0,0 +1,52 @@
+   * Tests the html head links.

This sounds wrong.

Other than that, this is RTBC to me.

plopesc’s picture

StatusFileSize
new2.16 KB
new540 bytes

Oh! I forgot to change that docblock after copy&paste... :-/

Sorry for the noise, new patch is here.

swentel’s picture

Status: Needs review » Reviewed & tested by the community

No problem, RTBC if green :)

alexpott’s picture

Title: 'language' extra field doesn't display the language selected in the node form » 'language' extra field doesn't display the language selected in the node form
Status: Reviewed & tested by the community » Fixed

Committed 7e41e96 and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

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