Updated: Comment #N

Problem/Motivation

The new entity translation API allows to pass around an entity object for a given language with

<?php
 $entity
->getTranslation('de');
?>

.

That makes the $langcode arguments useless and confusing (which language should be used now?), so it should be removed.

Proposed resolution

Remove $langcode from all $entity_view(), view_multiple() and render controller methods. Make sure that the correct translation is passed in elsewhere.

Remaining tasks

Write the patch. Possibly handle configuration entities somehow.

User interface changes

-

API changes

Removal of the additional arguments. Different way to access the entity fields, which is in line with the ongoing EntityNG changes.

#2072945: Remove $langcode parameter from EntityAccessControllerInterface::access() and friends

Files: 
CommentFileSizeAuthor
#8 langcode-view-2073217-8.patch39.79 KBBerdir
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch langcode-view-2073217-8.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Comments

Berdir’s picture

Status:Active» Needs review
StatusFileSize
new39.66 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch langcode-view-2073217-1.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Getting started to see how this goes.

Haven't touched formatter and widget methods yet, but we want to remove it there as well.

Berdir’s picture

Priority:Normal» Major

Status:Needs review» Needs work
Issue tags:-API change, -Entity Field API

The last submitted patch, langcode-view-2073217-1.patch, failed testing.

Berdir’s picture

Status:Needs work» Needs review

#1: langcode-view-2073217-1.patch queued for re-testing.

Status:Needs review» Needs work
Issue tags:+API change, +Entity Field API

The last submitted patch, langcode-view-2073217-1.patch, failed testing.

Berdir’s picture

Status:Needs work» Needs review
StatusFileSize
new38.7 KB
FAILED: [[SimpleTest]]: [MySQL] 58,806 pass(es), 1 fail(s), and 110 exception(s).
[ View ]

Re-roll.

Status:Needs review» Needs work

The last submitted patch, langcode-view-2073217-6.patch, failed testing.

Berdir’s picture

Status:Needs work» Needs review
StatusFileSize
new1.46 KB
new39.79 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch langcode-view-2073217-8.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Interesting, looks like search is the only use case that we have right where the global language negotation logic doesn't work.

So the multilingual test will continue to fail, but the notices should be fixed.

This will then need the language changes that are going in other changes to simply use the entity in the right language.

The last submitted patch, langcode-view-2073217-8.patch, failed testing.

plach’s picture

Issue summary:View changes
Parent issue:» #2160965: Content entities are not upcast in the page language, inconsistent with config entities
Related issues:+#2006606: Views rendering ignores entity language, eg: Identical nodes rendered in views when nodes have translations
jibran’s picture

Status:Needs work» Needs review

8: langcode-view-2073217-8.patch queued for re-testing.

Status:Needs review» Needs work

The last submitted patch, 8: langcode-view-2073217-8.patch, failed testing.