diff --git a/core/modules/node/config/optional/views.view.content.yml b/core/modules/node/config/optional/views.view.content.yml index a3387be..f431fcc 100644 --- a/core/modules/node/config/optional/views.view.content.yml +++ b/core/modules/node/config/optional/views.view.content.yml @@ -178,21 +178,67 @@ display: id: type table: node_field_data field: type + relationship: none + group_type: group + admin_label: '' label: 'Content Type' exclude: false alter: alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' element_default_classes: true empty: '' hide_empty: false empty_zero: false hide_alter_empty: true - link_to_node: false - machine_name: '' - plugin_id: node_type + click_sort_column: target_id + type: entity_reference_label + settings: + link: false + group_column: target_id + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false entity_type: node entity_field: type + plugin_id: field name: id: name table: users_field_data @@ -232,8 +278,8 @@ display: type: boolean settings: format: custom - format_custom_true: 'Published' - format_custom_false: 'Unpublished' + format_custom_true: Published + format_custom_false: Unpublished plugin_id: field entity_type: node entity_field: status @@ -509,10 +555,18 @@ display: operator: AND groups: 1: AND + display_extenders: { } display_plugin: default display_title: Master id: default position: 0 + cache_metadata: + contexts: + - languages + - url + - user + - 'user.node_grants:view' + cacheable: false page_1: display_options: path: admin/content/node @@ -529,7 +583,15 @@ display: description: 'Find and manage content' menu_name: admin weight: -10 + display_extenders: { } display_plugin: page display_title: Page id: page_1 position: 1 + cache_metadata: + contexts: + - languages + - url + - user + - 'user.node_grants:view' + cacheable: false diff --git a/core/modules/node/config/schema/node.views.schema.yml b/core/modules/node/config/schema/node.views.schema.yml index 42e60d0..abd96b6 100644 --- a/core/modules/node/config/schema/node.views.schema.yml +++ b/core/modules/node/config/schema/node.views.schema.yml @@ -169,14 +169,6 @@ views.field.node_revision_link_revert: type: label label: 'Text to display' -views.field.node_type: - type: views.field.node - label: 'Node type' - mapping: - machine_name: - type: string - label: 'Output machine name' - views.filter.node_access: type: views_filter label: 'Node access' diff --git a/core/modules/node/src/NodeViewsData.php b/core/modules/node/src/NodeViewsData.php index 939e51b..22fa8d3 100644 --- a/core/modules/node/src/NodeViewsData.php +++ b/core/modules/node/src/NodeViewsData.php @@ -35,7 +35,6 @@ public function getViewsData() { $data['node_field_data']['title']['field']['link_to_node default'] = TRUE; - $data['node_field_data']['type']['field']['id'] = 'node_type'; $data['node_field_data']['type']['argument']['id'] = 'node_type'; $data['node_field_data']['langcode']['help'] = t('The language of the content or translation.'); diff --git a/core/modules/node/src/Plugin/views/field/Type.php b/core/modules/node/src/Plugin/views/field/Type.php deleted file mode 100644 index 0107c9a..0000000 --- a/core/modules/node/src/Plugin/views/field/Type.php +++ /dev/null @@ -1,105 +0,0 @@ -nodeTypeStorage = $storage; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - $entity_manager = $container->get('entity.manager'); - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $entity_manager->getStorage('node_type') - ); - } - - /** - * {@inheritdoc} - */ - protected function defineOptions() { - $options = parent::defineOptions(); - $options['machine_name'] = array('default' => FALSE); - - return $options; - } - - /** - * Provide machine_name option for to node type display. - */ - public function buildOptionsForm(&$form, FormStateInterface $form_state) { - parent::buildOptionsForm($form, $form_state); - - $form['machine_name'] = array( - '#title' => $this->t('Output machine name'), - '#description' => $this->t('Display field as the content type machine name.'), - '#type' => 'checkbox', - '#default_value' => !empty($this->options['machine_name']), - ); - } - - /** - * Render node type as human readable name, unless using machine_name option. - */ - function render_name($data, $values) { - if ($this->options['machine_name'] != 1 && $data !== NULL && $data !== '') { - $type = $this->nodeTypeStorage->load($data); - return $type ? $this->t($this->sanitizeValue($type->label())) : ''; - } - return $this->sanitizeValue($data); - } - - /** - * {@inheritdoc} - */ - public function render(ResultRow $values) { - $value = $this->getValue($values); - return $this->renderLink($this->render_name($value, $values), $values); - } - -} diff --git a/core/modules/node/src/Tests/Views/FieldTypeTest.php b/core/modules/node/src/Tests/Views/FieldTypeTest.php deleted file mode 100644 index 7f20b55..0000000 --- a/core/modules/node/src/Tests/Views/FieldTypeTest.php +++ /dev/null @@ -1,42 +0,0 @@ -drupalCreateNode(); - $expected_result[] = array( - 'nid' => $node->id(), - 'node_field_data_type' => $node->bundle(), - ); - $column_map = array( - 'nid' => 'nid', - 'node_field_data_type' => 'node_field_data_type', - ); - - $view = Views::getView('test_field_type'); - $this->executeView($view); - $this->assertIdenticalResultset($view, $expected_result, $column_map, 'The correct node type was displayed.'); - } - -} diff --git a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_field_type.yml b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_field_type.yml deleted file mode 100644 index f8aba1a..0000000 --- a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_field_type.yml +++ /dev/null @@ -1,28 +0,0 @@ -langcode: en -status: true -dependencies: - module: - - node -id: test_field_type -label: '' -module: views -description: '' -tag: '' -base_table: node_field_data -base_field: nid -core: '8' -display: - default: - display_options: - fields: - type: - field: type - id: type - table: node_field_data - plugin_id: node_type - entity_type: node - entity_field: type - display_plugin: default - display_title: Master - id: default - position: 0 diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_type_filter.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_type_filter.yml index 6cfb96a..745140b 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_type_filter.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_entity_type_filter.yml @@ -34,7 +34,7 @@ display: relationship: none group_type: group admin_label: '' - label: Type + label: 'Content Type' exclude: false alter: alter_text: false @@ -75,9 +75,23 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - plugin_id: node_type + click_sort_column: target_id + type: entity_reference_label + settings: + link: false + group_column: target_id + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false entity_type: node entity_field: type + plugin_id: field defaults: fields: false filters: false diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_admin_ui.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_admin_ui.yml index 32b0692..d73c2ef 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_admin_ui.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_admin_ui.yml @@ -31,7 +31,6 @@ display: field: type id: type table: node_field_data - plugin_id: node_type entity_type: node entity_field: type body_value: