Pull merge.
[yaffs-website] / web / core / modules / node / src / NodeViewsData.php
index a122203d6f8ff38b5ef3ecce9491b7bc451a0a2a..35ef2978ea09eb55d02ea4380b959bd7b0ac028e 100644 (file)
@@ -216,6 +216,10 @@ class NodeViewsData extends EntityViewsData {
     $data['node_field_revision']['nid']['relationship']['base field'] = 'nid';
     $data['node_field_revision']['nid']['relationship']['title'] = $this->t('Content');
     $data['node_field_revision']['nid']['relationship']['label'] = $this->t('Get the actual content from a content revision.');
+    $data['node_field_revision']['nid']['relationship']['extra'][] = [
+      'field' => 'langcode',
+      'left_field' => 'langcode',
+    ];
 
     $data['node_field_revision']['vid'] = [
       'argument' => [
@@ -228,6 +232,12 @@ class NodeViewsData extends EntityViewsData {
         'base field' => 'vid',
         'title' => $this->t('Content'),
         'label' => $this->t('Get the actual content from a content revision.'),
+        'extra' => [
+          [
+            'field' => 'langcode',
+            'left_field' => 'langcode',
+          ],
+        ],
       ],
     ] + $data['node_field_revision']['vid'];
 
@@ -280,7 +290,7 @@ class NodeViewsData extends EntityViewsData {
 
     // Define the base group of this table. Fields that don't have a group defined
     // will go into this field by default.
-    $data['node_access']['table']['group']  = $this->t('Content access');
+    $data['node_access']['table']['group'] = $this->t('Content access');
 
     // For other base tables, explain how we join.
     $data['node_access']['table']['join'] = [
@@ -322,7 +332,7 @@ class NodeViewsData extends EntityViewsData {
             'field' => 'sid',
             'table' => 'search_index',
             'extra' => "node_search_index.type = 'node_search' AND node_search_index.langcode = node_field_data.langcode",
-          ]
+          ],
         ];
 
         $data['node_search_total']['table']['join'] = [