diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php index ecb33ee..7cb3f26 100644 --- a/core/lib/Drupal/Core/Entity/EntityManager.php +++ b/core/lib/Drupal/Core/Entity/EntityManager.php @@ -261,10 +261,10 @@ protected function processDefinition(&$definition, $plugin_id) { foreach ($view_modes as $config_name) { $view_mode = $config_factory->get($config_name)->load()->get(); if ($view_mode['targetEntityType'] == $plugin_id) { - $entity_type = strtok($view_mode['machineName'], '.'); + $entity_type = strtok($view_mode['id'], '.'); $definition['view_modes'][strtok('.')] = array( - 'label' => check_plain($view_mode['name']), - 'custom_settings' => $view_mode['custom'], + 'label' => check_plain($view_mode['label']), + 'custom_settings' => $view_mode['hasSettings'], ); } } diff --git a/core/lib/Drupal/Core/Plugin/Core/Entity/EntityViewMode.php b/core/lib/Drupal/Core/Plugin/Core/Entity/EntityViewMode.php index 074d165..bebd5eb 100644 --- a/core/lib/Drupal/Core/Plugin/Core/Entity/EntityViewMode.php +++ b/core/lib/Drupal/Core/Plugin/Core/Entity/EntityViewMode.php @@ -22,8 +22,8 @@ * config_prefix = "view_mode", * fieldable = FALSE, * entity_keys = { - * "id" = "machineName", - * "label" = "name", + * "id" = "id", + * "label" = "label", * "uuid" = "uuid" * } * ) @@ -31,11 +31,11 @@ class EntityViewMode extends ConfigEntityBase { /** - * The machine-readable name of the view mode. + * The id of the view mode. * * @var string */ - public $machineName; + public $id; /** * The UUID of the view mode. @@ -49,7 +49,7 @@ class EntityViewMode extends ConfigEntityBase { * * @var string */ - public $name; + public $label; /** * The entity type this view mode is used for. @@ -65,11 +65,9 @@ class EntityViewMode extends ConfigEntityBase { /** * Whether or not this view mode has custom settings by default. * - * Field UI allows to override this setting per bundle. - * * @var bool */ - public $custom = FALSE; + public $hasSettings = FALSE; /** * Whether or not this view mode can be removed. @@ -81,20 +79,13 @@ class EntityViewMode extends ConfigEntityBase { public $locked = FALSE; /** - * Overrides Drupal\Core\Core\Entity\Entity::id(). - */ - public function id() { - return $this->machineName; - } - - /** * Returns the raw view mode name, exluding the entity type. * * @return string * The raw view mode name. */ public function name() { - $name = strtok($this->machineName, '.'); + $name = strtok($this->name, '.'); return strtok('.'); } diff --git a/core/modules/book/config/view_mode.node.print.yml b/core/modules/book/config/view_mode.node.print.yml index df756d1..c1290fd 100644 --- a/core/modules/book/config/view_mode.node.print.yml +++ b/core/modules/book/config/view_mode.node.print.yml @@ -1,5 +1,5 @@ -machineName: node.print -name: Print -custom: '0' +id: node.print +label: Print +hasSettings: '0' targetEntityType: node locked: '1' diff --git a/core/modules/comment/config/view_mode.comment.full.yml b/core/modules/comment/config/view_mode.comment.full.yml index 6de56e7..1549c46 100644 --- a/core/modules/comment/config/view_mode.comment.full.yml +++ b/core/modules/comment/config/view_mode.comment.full.yml @@ -1,5 +1,5 @@ -machineName: comment.full -name: Full comment -custom: '0' +id: comment.full +label: Full comment +hasSettings: '0' targetEntityType: comment locked: '1' diff --git a/core/modules/file/config/view_mode.file.full.yml b/core/modules/file/config/view_mode.file.full.yml index 1136c3a..743e2d1 100644 --- a/core/modules/file/config/view_mode.file.full.yml +++ b/core/modules/file/config/view_mode.file.full.yml @@ -1,5 +1,5 @@ -machineName: file.full -name: File default -custom: '0' +id: file.full +label: File default +hasSettings: '0' targetEntityType: file locked: '1' diff --git a/core/modules/node/config/view_mode.node.full.yml b/core/modules/node/config/view_mode.node.full.yml index 4630674..e3fe426 100644 --- a/core/modules/node/config/view_mode.node.full.yml +++ b/core/modules/node/config/view_mode.node.full.yml @@ -1,5 +1,5 @@ -machineName: node.full -name: Full content -custom: '0' +id: node.full +label: Full content +hasSettings: '0' targetEntityType: node locked: '1' diff --git a/core/modules/node/config/view_mode.node.rss.yml b/core/modules/node/config/view_mode.node.rss.yml index 6de18d1..5b29601 100644 --- a/core/modules/node/config/view_mode.node.rss.yml +++ b/core/modules/node/config/view_mode.node.rss.yml @@ -1,5 +1,5 @@ -machineName: node.rss -name: RSS -custom: '0' +id: node.rss +label: RSS +hasSettings: '0' targetEntityType: node locked: '1' diff --git a/core/modules/node/config/view_mode.node.teaser.yml b/core/modules/node/config/view_mode.node.teaser.yml index e7478ad..8d83192 100644 --- a/core/modules/node/config/view_mode.node.teaser.yml +++ b/core/modules/node/config/view_mode.node.teaser.yml @@ -1,5 +1,5 @@ -machineName: node.teaser -name: Teaser -custom: '1' +id: node.teaser +label: Teaser +hasSettings: '1' targetEntityType: node locked: '1' diff --git a/core/modules/search/config/view_mode.node.search_index.yml b/core/modules/search/config/view_mode.node.search_index.yml index 32fab57..cd98947 100644 --- a/core/modules/search/config/view_mode.node.search_index.yml +++ b/core/modules/search/config/view_mode.node.search_index.yml @@ -1,5 +1,5 @@ -machineName: node.search_index -name: Search index -custom: '0' +id: node.search_index +label: Search index +hasSettings: '0' targetEntityType: node locked: '1' diff --git a/core/modules/search/config/view_mode.node.search_result.yml b/core/modules/search/config/view_mode.node.search_result.yml index da2d0d2..ab6fe86 100644 --- a/core/modules/search/config/view_mode.node.search_result.yml +++ b/core/modules/search/config/view_mode.node.search_result.yml @@ -1,5 +1,5 @@ -machineName: node.search_result -name: Search result -custom: '0' +id: node.search_result +label: Search result +hasSettings: '0' targetEntityType: node locked: '1' diff --git a/core/modules/taxonomy/config/view_mode.taxonomy_term.full.yml b/core/modules/taxonomy/config/view_mode.taxonomy_term.full.yml index 37af637..4203a25 100644 --- a/core/modules/taxonomy/config/view_mode.taxonomy_term.full.yml +++ b/core/modules/taxonomy/config/view_mode.taxonomy_term.full.yml @@ -1,5 +1,5 @@ -machineName: taxonomy_term.full -name: Taxonomy term page -custom: '0' +id: taxonomy_term.full +label: Taxonomy term page +hasSettings: '0' targetEntityType: taxonomy_term locked: '1' diff --git a/core/modules/taxonomy/config/view_mode.taxonomy_vocabulary.full.yml b/core/modules/taxonomy/config/view_mode.taxonomy_vocabulary.full.yml index d52effd..1f8cfd9 100644 --- a/core/modules/taxonomy/config/view_mode.taxonomy_vocabulary.full.yml +++ b/core/modules/taxonomy/config/view_mode.taxonomy_vocabulary.full.yml @@ -1,5 +1,5 @@ -machineName: vocabulary.full -name: Taxonomy vocabulary -custom: '0' +id: vocabulary.full +label: Taxonomy vocabulary +hasSettings: '0' targetEntityType: taxonomy_vocabulary locked: '1' diff --git a/core/modules/user/config/view_mode.user.full.yml b/core/modules/user/config/view_mode.user.full.yml index 020651b..cd81d36 100644 --- a/core/modules/user/config/view_mode.user.full.yml +++ b/core/modules/user/config/view_mode.user.full.yml @@ -1,5 +1,5 @@ -machineName: user.full -name: User account -custom: '0' +id: user.full +label: User account +hasSettings: '0' targetEntityType: user locked: '1'