diff --git a/core/modules/comment/src/Plugin/views/field/LinkApprove.php b/core/modules/comment/src/Plugin/views/field/LinkApprove.php index a68e783..56ee45e 100644 --- a/core/modules/comment/src/Plugin/views/field/LinkApprove.php +++ b/core/modules/comment/src/Plugin/views/field/LinkApprove.php @@ -43,7 +43,7 @@ public function access(AccountInterface $account) { * Returns a string for the link text. */ protected function renderLink(EntityInterface $entity, ResultRow $values) { - $status = $this->getValue($values, 'status'); + $status = $this->getEntity($values, 'status'); // Don't show an approve link on published comment. if ($status == CommentInterface::PUBLISHED) { diff --git a/core/modules/content_translation/tests/modules/content_translation_test_views/test_views/views.view.test_entity_translations_link.yml b/core/modules/content_translation/tests/modules/content_translation_test_views/test_views/views.view.test_entity_translations_link.yml index 2fba01d..87da0bb 100644 --- a/core/modules/content_translation/tests/modules/content_translation_test_views/test_views/views.view.test_entity_translations_link.yml +++ b/core/modules/content_translation/tests/modules/content_translation_test_views/test_views/views.view.test_entity_translations_link.yml @@ -54,10 +54,10 @@ display: type: user_name entity_type: user entity_field: name - translate_user: - id: translate_user + translation_link: + id: translation_link table: users - field: translate_user + field: translation_link label: 'Translation link' exclude: false alter: diff --git a/core/modules/views/config/schema/views.field.schema.yml b/core/modules/views/config/schema/views.field.schema.yml index 6586d82..8e8c587 100644 --- a/core/modules/views/config/schema/views.field.schema.yml +++ b/core/modules/views/config/schema/views.field.schema.yml @@ -185,22 +185,6 @@ views.field.entity_link: type: label label: 'Text to display' -views.field.entity_link_delete: - type: views.field.entity_link - label: 'Entity delete link' - mapping: - text: - type: label - label: 'Text to display' - -views.field.entity_link_edit: - type: views.field.entity_link - label: 'Entity edit link' - mapping: - text: - type: label - label: 'Text to display' - views.field.bulk_form: type: views_field_bulk_form label: 'Bulk form' diff --git a/core/modules/views/src/EntityViewsData.php b/core/modules/views/src/EntityViewsData.php index 9cbb31c..ae31d6e 100644 --- a/core/modules/views/src/EntityViewsData.php +++ b/core/modules/views/src/EntityViewsData.php @@ -268,10 +268,10 @@ protected function addEntityLinks(array &$data) { ]; } if ($this->entityType->hasLinkTemplate('drupal:content-translation-overview')) { - $data['translate_' . $entity_type_id] = [ + $data['translation_link' . $entity_type_id] = [ 'field' => [ 'title' => $this->t('Link to translate @entity_type_label', $t_arguments), - 'help' => $this->t('Provide a translate link to the @entity_type_label.', $t_arguments), + 'help' => $this->t('Provide a translation link to the @entity_type_label.', $t_arguments), 'id' => 'content_translation_link', ], ]; diff --git a/core/modules/views/src/Plugin/views/field/EntityLink.php b/core/modules/views/src/Plugin/views/field/EntityLink.php index 7a93071..1046909 100644 --- a/core/modules/views/src/Plugin/views/field/EntityLink.php +++ b/core/modules/views/src/Plugin/views/field/EntityLink.php @@ -41,7 +41,6 @@ public function usesGroupBy() { */ protected function defineOptions() { $options = parent::defineOptions(); - $options['text'] = ['default' => '', 'translatable' => TRUE]; return $options; } @@ -106,13 +105,7 @@ protected function renderLink(EntityInterface $entity, ResultRow $values) { protected function addLangcode(ResultRow $values) { if (isset($this->aliases['langcode'])) { $languages = language_list(); - $langcode = $this->getEntity($values, 'langcode'); - if (isset($languages[$langcode])) { - $this->options['alter']['language'] = $languages[$langcode]; - } - else { - unset($this->options['alter']['language']); - } + $this->options['alter']['language'] = $this->getEntity($values)->language(); } } } diff --git a/core/modules/views/src/Plugin/views/field/EntityLinkDelete.php b/core/modules/views/src/Plugin/views/field/EntityLinkDelete.php index 3e3a94a..abbd4e4 100644 --- a/core/modules/views/src/Plugin/views/field/EntityLinkDelete.php +++ b/core/modules/views/src/Plugin/views/field/EntityLinkDelete.php @@ -26,7 +26,7 @@ protected function renderLink(EntityInterface $entity, ResultRow $values) { // Ensure user has access to delete this node. if ($entity && $entity->access('delete')) { $this->options['alter']['make_link'] = TRUE; - $this->options['alter']['path'] = $entity->getSystemPath('delete-form'); + $this->options['alter']['url'] = $entity->urlInfo('delete-form'); $this->options['alter']['query'] = drupal_get_destination(); $this->addLangcode($values); diff --git a/core/modules/views/src/Plugin/views/field/EntityLinkEdit.php b/core/modules/views/src/Plugin/views/field/EntityLinkEdit.php index d1f40ca..9dd7a2a 100644 --- a/core/modules/views/src/Plugin/views/field/EntityLinkEdit.php +++ b/core/modules/views/src/Plugin/views/field/EntityLinkEdit.php @@ -26,7 +26,7 @@ protected function renderLink(EntityInterface $entity, ResultRow $values) { // Ensure user has access to delete this node. if ($entity && $entity->access('update')) { $this->options['alter']['make_link'] = TRUE; - $this->options['alter']['path'] = $entity->getSystemPath('edit-form'); + $this->options['alter']['url'] = $entity->urlInfo('edit-form'); $this->options['alter']['query'] = drupal_get_destination(); $this->addLangcode($values);