In Issue https://www.drupal.org/node/2451657 @dawehner pointed out that the patch of getValue is a separate issue. Calling getValue on the EntityField does not always return the translation that is selected by the result row.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | entityfield_getvalue-2866067-3.patch | 2.15 KB | k4v |
| #2 | entityfield_getvalue-2866067-2--testonly.patch | 1005 bytes | k4v |
Comments
Comment #2
k4v commentedI modified the RowEntityRendersTest to also check getValue on the entity field. Here is the test only patch.
Comment #3
k4v commentedThis is the change on EntityField from https://www.drupal.org/node/2451657 and the new test. Still fails...
Comment #4
k4v commentedComment #7
k4v commentedDid some more research on this. The test fails for the TranslationLanguageRenderer, where the View is configured to output the selected translation of the row.
Drupal\views\Entity\Render\TranslationLanguageRenderer::getLancode() returns the default Language, because $this->langcodeAlias is NULL.
Comment #8
k4v commentedSo that's because we did not call query() before... The langcode we are looking for is stored with the key of the table column alias (e.g. 'node_field_data_langcode). No idea how to fix this here.
Comment #9
k4v commentedComment #19
quietone commentedThis was fixed in 8.4.x in #2451657: Views should not condition joins on the langcode of fields that are not translatable
Closing as outdated.