diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLink.php b/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLink.php index 07e1acd..04439b5 100644 --- a/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLink.php +++ b/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLink.php @@ -59,7 +59,7 @@ function render_link($data, $values) { // Current revision uses the node view path. $uri = $node->uri(); $path = $uri['path']; - if ($this->countRevisions[$node->id()] > 1 && $node->vid != $vid) { + if ($this->countRevisions[$node->id()] > 1 && $node->getRevisionId() != $vid) { $path .= "/revisions/$vid/view"; } diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLinkDelete.php b/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLinkDelete.php index 009ff2f..c5f814a 100644 --- a/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLinkDelete.php +++ b/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLinkDelete.php @@ -28,7 +28,7 @@ function render_link($data, $values) { } // Current revision cannot be deleted. - if ($node->isDefaultRevision()) { + if ($node->getRevisionId() == $vid) { return; } diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLinkRevert.php b/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLinkRevert.php index 52e1e8f..80e05e4 100644 --- a/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLinkRevert.php +++ b/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLinkRevert.php @@ -28,7 +28,7 @@ function render_link($data, $values) { } // Current revision cannot be reverted. - if ($node->isDefaultRevision()) { + if ($node->getRevisionId() == $vid) { return; } diff --git a/core/modules/node/lib/Drupal/node/Tests/Views/RevisionLinkTest.php b/core/modules/node/lib/Drupal/node/Tests/Views/RevisionLinkTest.php index 033a700..79f442c 100644 --- a/core/modules/node/lib/Drupal/node/Tests/Views/RevisionLinkTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/Views/RevisionLinkTest.php @@ -29,9 +29,9 @@ class RevisionLinkTest extends NodeTestBase { public static function getInfo() { return array( - 'name' => 'Node Revision: Links', + 'name' => 'Node: Revision Links', 'description' => 'Tests the different revision link handlers.', - 'group' => 'Views Modules', + 'group' => 'Views module integration', ); } diff --git a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_revision_links.yml b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_revision_links.yml index eff51d1..b5f9dbf 100644 --- a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_revision_links.yml +++ b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_revision_links.yml @@ -1,27 +1,46 @@ -api_version: '3.0' base_field: vid -base_table: node_revision +base_table: node_field_revision core: 8.x description: '' -disabled: '0' +status: '0' display: default: display_plugin: default id: default display_title: Master - position: '' + position: '1' display_options: access: type: perm + options: + perm: 'access content' perm: 'view revisions' cache: type: none + options: { } query: type: views_query + options: + disable_sql_rewrite: '0' + distinct: '0' + slave: '0' + query_comment: '' + query_tags: { } exposed_form: type: basic + options: + submit_button: Apply + reset_button: '0' + reset_button_label: Reset + exposed_sorts_label: 'Sort by' + expose_sort_order: '1' + sort_asc_label: Asc + sort_desc_label: Desc pager: - type: full + type: none + options: + items_per_page: '0' + offset: '0' style: type: default row: @@ -29,35 +48,180 @@ display: fields: link_to_revision: id: link_to_revision - table: node_revision + table: node_field_revision field: link_to_revision + relationship: none + group_type: group + admin_label: '' + label: 'Link to revision' + exclude: '0' + alter: + alter_text: '0' + text: '' + make_link: '0' + path: '' + absolute: '0' + external: '0' + replace_spaces: '0' + path_case: none + trim_whitespace: '0' + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: '0' + max_length: '' + word_boundary: '1' + ellipsis: '1' + more_link: '0' + more_link_text: '' + more_link_path: '' + strip_tags: '0' + trim: '0' + preserve_tags: '' + html: '0' + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: '1' + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: '1' + empty: '' + hide_empty: '0' + empty_zero: '0' + hide_alter_empty: '1' + text: '' + plugin_id: node_revision_link delete_revision: id: delete_revision - table: node_revision + table: node_field_revision field: delete_revision + relationship: none + group_type: group + admin_label: '' + label: 'Link to delete revision' + exclude: '0' + alter: + alter_text: '0' + text: '' + make_link: '0' + path: '' + absolute: '0' + external: '0' + replace_spaces: '0' + path_case: none + trim_whitespace: '0' + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: '0' + max_length: '' + word_boundary: '1' + ellipsis: '1' + more_link: '0' + more_link_text: '' + more_link_path: '' + strip_tags: '0' + trim: '0' + preserve_tags: '' + html: '0' + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: '1' + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: '1' + empty: '' + hide_empty: '0' + empty_zero: '0' + hide_alter_empty: '1' + text: '' + plugin_id: node_revision_link_delete revert_revision: id: revert_revision - table: node_revision + table: node_field_revision field: revert_revision + relationship: none + group_type: group + admin_label: '' + label: 'Link to revert revision' + exclude: '0' + alter: + alter_text: '0' + text: '' + make_link: '0' + path: '' + absolute: '0' + external: '0' + replace_spaces: '0' + path_case: none + trim_whitespace: '0' + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: '0' + max_length: '' + word_boundary: '1' + ellipsis: '1' + more_link: '0' + more_link_text: '' + more_link_path: '' + strip_tags: '0' + trim: '0' + preserve_tags: '' + html: '0' + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: '1' + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: '1' + empty: '' + hide_empty: '0' + empty_zero: '0' + hide_alter_empty: '1' + text: '' + plugin_id: node_revision_link_revert filters: status: value: '1' - table: node_revision + table: node_field_revision field: status id: status expose: operator: '0' group: '1' sorts: { } + title: test_node_revision_links + header: { } + footer: { } + empty: { } + relationships: { } + arguments: { } page_1: display_plugin: page id: page_1 display_title: Page - position: '' + position: '1' display_options: path: test-node-revision-links -human_name: test_node_revision_links +label: test_node_revision_links module: views -name: test_node_revision_links +id: test_node_revision_links tag: '' -uuid: b1ab4547-dcf3-49c1-b900-d270ace37c53 +uuid: c89579e2-be88-44e6-81f8-6d5e50b81a05 +langcode: en