Commit 8ff6a61f authored by alexpott's avatar alexpott

Issue #2320521 by jhodgdon: Fixed Follow-up: Node language views filters need label adjustments.

parent 2e7b4559
......@@ -303,6 +303,9 @@ public function getViewsData() {
$data['node_field_revision']['title']['field']['id'] = 'node_revision';
$data['node_field_revision']['langcode']['help'] = t('The language of the content or translation.');
$data['node_field_revision']['langcode']['field']['id'] = 'node_language';
$data['node_revision']['link_to_revision'] = array(
'field' => array(
'title' => t('Link to revision'),
......
......@@ -375,10 +375,10 @@ protected function mapSingleFieldViewsData($table, $data_type, $schema_field_nam
protected function processViewsDataForLanguage($table, FieldDefinitionInterface $field_definition, array &$views_field) {
// Apply special titles for the langcode field.
if ($field_definition->getName() == 'langcode') {
if ($table == $this->entityType->getDataTable() || $table == $this->entityType->getBaseTable()) {
if ($table == $this->entityType->getDataTable() || $table == $this->entityType->getRevisionDataTable()) {
$views_field['title'] = $this->t('Translation language');
}
if ($table == $this->entityType->getRevisionDataTable() || $table == $this->entityType->getRevisionTable()) {
if ($table == $this->entityType->getBaseTable() || $table == $this->entityType->getRevisionTable()) {
$views_field['title'] = $this->t('Original language');
}
}
......
......@@ -303,7 +303,7 @@ public function testBaseTableFields() {
$this->assertStringField($data['entity_test']['type']);
$this->assertLanguageField($data['entity_test']['langcode']);
$this->assertEquals('Translation language', $data['entity_test']['langcode']['title']);
$this->assertEquals('Original language', $data['entity_test']['langcode']['title']);
$this->assertStringField($data['entity_test']['name']);
......@@ -502,7 +502,7 @@ public function testRevisionTableFields() {
$this->assertNumericField($data['entity_test_mulrev_property_revision']['id']);
$this->assertLanguageField($data['entity_test_mulrev_property_revision']['langcode']);
$this->assertEquals('Original language', $data['entity_test_mulrev_property_revision']['langcode']['title']);
$this->assertEquals('Translation language', $data['entity_test_mulrev_property_revision']['langcode']['title']);
$this->assertStringField($data['entity_test_mulrev_property_revision']['name']);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment