--- 1043198-93.patch 2012-10-23 01:43:43.105496723 +0200 +++ 1043198-125-re-roll.patch 2012-10-31 23:45:30.298734214 +0100 @@ -1,96 +1,194 @@ -diff --git a/core/includes/entity.api.php b/core/includes/entity.api.php -index e9fb855..bd7590a 100644 ---- a/core/includes/entity.api.php -+++ b/core/includes/entity.api.php -@@ -120,27 +120,6 @@ - * - access callback: As in hook_menu(). 'user_access' will be assumed if - * no value is provided. - * - access arguments: As in hook_menu(). -- * - view modes: An array describing the view modes for the entity type. View -- * modes let entities be displayed differently depending on the context. -- * For instance, a node can be displayed differently on its own page -- * ('full' mode), on the home page or taxonomy listings ('teaser' mode), or -- * in an RSS feed ('rss' mode). Modules taking part in the display of the -- * entity (notably the Field API) can adjust their behavior depending on -- * the requested view mode. An additional 'default' view mode is available -- * for all entity types. This view mode is not intended for actual entity -- * display, but holds default display settings. For each available view -- * mode, administrators can configure whether it should use its own set of -- * field display settings, or just replicate the settings of the 'default' -- * view mode, thus reducing the amount of display configurations to keep -- * track of. Keys of the array are view mode names. Each view mode is -- * described by an array with the following key/value pairs: -- * - label: The human-readable name of the view mode -- * - custom settings: A boolean specifying whether the view mode should by -- * default use its own custom field display settings. If FALSE, entities -- * displayed in this view mode will reuse the 'default' display settings -- * by default (e.g. right after the module exposing the view mode is -- * enabled), but administrators can later use the Field UI to apply custom -- * display settings specific to the view mode. - * - * @see entity_load() - * @see entity_load_multiple() -@@ -172,20 +151,6 @@ function hook_entity_info() { - 'bundle' => 'type', - ), - 'bundles' => array(), -- 'view modes' => array( -- 'full' => array( -- 'label' => t('Full content'), -- 'custom settings' => FALSE, -- ), -- 'teaser' => array( -- 'label' => t('Teaser'), -- 'custom settings' => TRUE, -- ), -- 'rss' => array( -- 'label' => t('RSS'), -- 'custom settings' => FALSE, -- ), -- ), - ), - ); - diff --git a/core/includes/entity.inc b/core/includes/entity.inc -index 48ee728..8956fd8 100644 +index 03c3ffa..1983f53 100644 --- a/core/includes/entity.inc +++ b/core/includes/entity.inc -@@ -64,11 +64,6 @@ function entity_get_info($entity_type = NULL) { - 'revision' => '', - 'bundle' => '', - ); -- foreach ($entity_info[$name]['view modes'] as $view_mode => $view_mode_info) { -- $entity_info[$name]['view modes'][$view_mode] += array( -- 'custom settings' => FALSE, -- ); -- } - // If no bundle key is provided, assume a single bundle, named after - // the entity type. - if (empty($entity_info[$name]['entity keys']['bundle']) && empty($entity_info[$name]['bundles'])) { -@@ -83,6 +78,17 @@ function entity_get_info($entity_type = NULL) { - } - } - } -+ -+ // Add view modes. -+ foreach (entity_load_multiple('view_mode') as $view_mode) { -+ if (isset($entity_info[$view_mode->type])) { -+ $entity_info[$view_mode->type]['view modes'][$view_mode->name()] = array( -+ 'label' => check_plain($view_mode->label()), -+ 'custom settings' => $view_mode->custom, -+ ); -+ } -+ } +@@ -260,7 +260,7 @@ function entity_get_controller($entity_type) { + if (!isset($controllers[$entity_type])) { + $type_info = entity_get_info($entity_type); + $class = $type_info['controller_class']; +- $controllers[$entity_type] = new $class($entity_type); ++ $controllers[$entity_type] = new $class($entity_type, $type_info); + } + return $controllers[$entity_type]; + } +diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php b/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php +index 60c6aa1..6c4f668 100644 +--- a/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php ++++ b/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php +@@ -57,13 +57,18 @@ class ConfigStorageController implements EntityStorageControllerInterface { + protected $uuidKey = 'uuid'; + + /** +- * Implements Drupal\Core\Entity\EntityStorageControllerInterface::__construct(). ++ * Constructs a ConfigStorageController object. + * + * Sets basic variables. ++ * ++ * @param string $entity_type ++ * The entity type for which the instance is created. ++ * @param array $entity_info ++ * The entity info of the entity type above. + */ +- public function __construct($entityType) { +- $this->entityType = $entityType; +- $this->entityInfo = entity_get_info($entityType); ++ public function __construct($entity_type, $entity_info) { ++ $this->entityType = $entity_type; ++ $this->entityInfo = $entity_info; + $this->hookLoadArguments = array(); + $this->idKey = $this->entityInfo['entity_keys']['id']; + } +diff --git a/core/lib/Drupal/Core/Entity/DatabaseStorageController.php b/core/lib/Drupal/Core/Entity/DatabaseStorageController.php +index 14fca02..b98d0ac 100644 +--- a/core/lib/Drupal/Core/Entity/DatabaseStorageController.php ++++ b/core/lib/Drupal/Core/Entity/DatabaseStorageController.php +@@ -109,12 +109,14 @@ class DatabaseStorageController implements EntityStorageControllerInterface { + /** + * Constructs a DatabaseStorageController object. + * +- * @param string $entityType ++ * @param string $entity_type + * The entity type for which the instance is created. ++ * @param array $entity_info ++ * The entity info of the entity type above. + */ +- public function __construct($entityType) { +- $this->entityType = $entityType; +- $this->entityInfo = entity_get_info($entityType); ++ public function __construct($entity_type, $entity_info) { ++ $this->entityType = $entity_type; ++ $this->entityInfo = $entity_info; + $this->entityCache = array(); + $this->hookLoadArguments = array(); + $this->idKey = $this->entityInfo['entity_keys']['id']; +diff --git a/core/lib/Drupal/Core/Entity/DatabaseStorageControllerNG.php b/core/lib/Drupal/Core/Entity/DatabaseStorageControllerNG.php +index 6f22d83..8b3eb8e 100644 +--- a/core/lib/Drupal/Core/Entity/DatabaseStorageControllerNG.php ++++ b/core/lib/Drupal/Core/Entity/DatabaseStorageControllerNG.php +@@ -37,10 +37,15 @@ class DatabaseStorageControllerNG extends DatabaseStorageController { + protected $bundleKey; + + /** +- * Overrides DatabaseStorageController::__construct(). ++ * Constructs a DatabaseStorageControllerNG object. ++ * ++ * @param string $entity_type ++ * The entity type for which the instance is created. ++ * @param array $entity_info ++ * The entity info of the entity type above. + */ +- public function __construct($entityType) { +- parent::__construct($entityType); ++ public function __construct($entity_type, $entity_info) { ++ parent::__construct($entity_type, $entity_info); + $this->bundleKey = !empty($this->entityInfo['entity_keys']['bundle']) ? $this->entityInfo['entity_keys']['bundle'] : FALSE; + $this->entityClass = $this->entityInfo['class']; + +diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php +index b8c38ce..1b3104f 100644 +--- a/core/lib/Drupal/Core/Entity/EntityManager.php ++++ b/core/lib/Drupal/Core/Entity/EntityManager.php +@@ -119,27 +119,6 @@ + * - access callback: As in hook_menu(). 'user_access' will be assumed if + * no value is provided. + * - access arguments: As in hook_menu(). +- * - view_modes: An array describing the view modes for the entity type. View +- * modes let entities be displayed differently depending on the context. +- * For instance, a node can be displayed differently on its own page +- * ('full' mode), on the home page or taxonomy listings ('teaser' mode), or +- * in an RSS feed ('rss' mode). Modules taking part in the display of the +- * entity (notably the Field API) can adjust their behavior depending on +- * the requested view mode. An additional 'default' view mode is available +- * for all entity types. This view mode is not intended for actual entity +- * display, but holds default display settings. For each available view +- * mode, administrators can configure whether it should use its own set of +- * field display settings, or just replicate the settings of the 'default' +- * view mode, thus reducing the amount of display configurations to keep +- * track of. Keys of the array are view mode names. Each view mode is +- * described by an array with the following key/value pairs: +- * - label: The human-readable name of the view mode. +- * - custom_settings: A boolean specifying whether the view mode should by +- * default use its own custom field display settings. If FALSE, entities +- * displayed in this view mode will reuse the 'default' display settings +- * by default (e.g. right after the module exposing the view mode is +- * enabled), but administrators can later use the Field UI to apply custom +- * display settings specific to the view mode. + * + * The defaults for the plugin definition are provided in + * \Drupal\Core\Entity\EntityManager::defaults. +@@ -238,6 +217,8 @@ public function getDefinitions() { + // @todo Remove array_filter() once http://drupal.org/node/1780396 is + // resolved. + $definitions = array_filter(parent::getDefinitions()); ++ // Allow to process all definitions at once. ++ $this->processDefinitions($definitions); + cache($this->cacheBin)->set($this->cacheKey, $definitions, $this->cacheExpire, $this->cacheTags); + return $definitions; + } +@@ -250,22 +231,17 @@ protected function processDefinition(&$definition, $plugin_id) { + parent::processDefinition($definition, $plugin_id); + + // @todo Remove this check once http://drupal.org/node/1780396 is resolved. +- if (!module_exists($definition['module'])) { ++ if ($definition['module'] != 'Core' && !module_exists($definition['module'])) { + $definition = NULL; + return; + } + +- foreach ($definition['view_modes'] as $view_mode => $view_mode_info) { +- $definition['view_modes'][$view_mode] += array( +- 'custom_settings' => FALSE, +- ); +- } +- + // If no bundle key is provided, assume a single bundle, named after + // the entity type. + if (empty($definition['entity_keys']['bundle']) && empty($definition['bundles'])) { + $definition['bundles'] = array($plugin_id => array('label' => $definition['label'])); + } ++ + // Prepare entity schema fields SQL info for + // Drupal\Core\Entity\DatabaseStorageControllerInterface::buildQuery(). + if (isset($definition['base_table'])) { +@@ -276,4 +252,32 @@ protected function processDefinition(&$definition, $plugin_id) { + } + } + ++ /** ++ * Performs extra processing on all plugin definitions at once. ++ * ++ * @param array $definitions ++ * An array of all plugin definitions, keyed by plugin ID, passed by ++ * reference. ++ */ ++ protected function processDefinitions(&$definitions) { ++ // Add view modes. ++ // This cannot be done in EntityManager::processDefinition as finding out ++ // the view mode entity's controller class would require calling ++ // EntityManager::getDefinition(), which calls ++ // EntityManager::getDefinitions() leading to recursion. For the same ++ // reason, we cannot call entity_get_controller() but need to instantiate ++ // the class directly. ++ $controller = new $definitions['view_mode']['controller_class']('view_mode', $definitions['view_mode']); ++ foreach ($controller->load() as $view_mode) { ++ $definitions[$view_mode->type]['view_modes'][$view_mode->name()] = array( ++ // Entity::label() calls entity_get_info(), so we cannot use it here. ++ // Note the difference between $view_mode->name() and $view_mode->name. ++ // @todo Make this work for classes other than ++ // \Drupal\Core\Plugin\Core\Entity\EntityViewMode. ++ 'label' => check_plain($view_mode->name), ++ 'custom_settings' => $view_mode->custom, ++ ); ++ } ++ } + - // Let other modules alter the entity info. - drupal_alter('entity_info', $entity_info); - cache()->set("entity_info:$langcode", $entity_info, CacheBackendInterface::CACHE_PERMANENT, array('entity_info' => TRUE)); + } diff --git a/core/lib/Drupal/Core/Entity/ViewMode/EntityViewMode.php b/core/lib/Drupal/Core/Entity/ViewMode/EntityViewMode.php new file mode 100644 -index 0000000..a4125dd +index 0000000..764c165 --- /dev/null +++ b/core/lib/Drupal/Core/Entity/ViewMode/EntityViewMode.php -@@ -0,0 +1,90 @@ +@@ -0,0 +1,102 @@ + 'Drupal\Core\Entity\ViewMode\EntityViewMode', ++ * 'controller_class' => 'Drupal\Core\Config\Entity\ConfigStorageController', ++ * 'config_prefix' => 'view_mode', ++ * 'fieldable' => FALSE, ++ * 'entity_keys' = { ++ * 'id' => 'machine_name', ++ * 'label' => 'name', ++ * 'uuid' => 'uuid' ++ * } ++ */ ++class EntityViewMode extends ConfigEntityBase { ++ ++ /** ++ * The machine name of the view mode. ++ * ++ * @var string ++ */ ++ public $machine_name; ++ ++ /** ++ * The UUID of the view mode. ++ * ++ * @var string ++ */ ++ public $uuid; ++ ++ /** ++ * The view mode label. ++ * ++ * @var string ++ */ ++ public $name; ++ ++ /** ++ * The entity type this view mode is used for. ++ * ++ * @var string ++ */ ++ public $type; ++ ++ /** ++ * Whether or not this view mode has custom settings in the Field UI. ++ * ++ * @var bool ++ */ ++ public $custom = FALSE; ++ ++ /** ++ * Whether or not this view mode can be removed. ++ * ++ * @var bool ++ */ ++ public $locked = FALSE; ++ ++ /** ++ * Overrides Drupal\Core\Core\Entity\Entity::id(). ++ */ ++ public function id() { ++ return $this->machine_name; ++ } ++ ++ /** ++ * Returns the raw view mode name, exluding the entity type. ++ * ++ * @return string ++ * The raw view mode name. ++ */ ++ public function name() { ++ $name = strtok($this->machine_name, '.'); ++ return strtok('.'); ++ } ++ ++ /** ++ * Overrides Drupal\Core\Core\Entity\Entity::uri(). ++ */ ++ public function uri() { ++ return array( ++ 'path' => 'admin/config/system/view-modes/' . $this->id(), ++ 'options' => array( ++ 'entity_type' => $this->entityType, ++ 'entity' => $this, ++ ), ++ ); ++ } ++ ++} +diff --git a/core/lib/Drupal/Core/Plugin/Core/Entity/EntityViewMode.php b/core/lib/Drupal/Core/Plugin/Core/Entity/EntityViewMode.php +new file mode 100644 +index 0000000..9026693 +--- /dev/null ++++ b/core/lib/Drupal/Core/Plugin/Core/Entity/EntityViewMode.php +@@ -0,0 +1,107 @@ ++ array( -- 'label' => t('Print'), -- 'custom settings' => FALSE, -- ), +- $info['node']['view_modes']['print'] = array( +- 'label' => t('Print'), +- 'custom_settings' => FALSE, - ); -} - @@ -216,23 +437,6 @@ index 0000000..1ed8183 +custom: '0' +type: node +locked: '1' -diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module -index df0a33a..f628422 100644 ---- a/core/modules/comment/comment.module -+++ b/core/modules/comment/comment.module -@@ -120,12 +120,6 @@ function comment_entity_info() { - ), - 'bundles' => array(), - 'render controller class' => 'Drupal\comment\CommentRenderController', -- 'view modes' => array( -- 'full' => array( -- 'label' => t('Full comment'), -- 'custom settings' => FALSE, -- ), -- ), - 'static cache' => FALSE, - ), - ); diff --git a/core/modules/comment/config/view_mode.comment.full.yml b/core/modules/comment/config/view_mode.comment.full.yml new file mode 100644 index 0000000..43b6233 @@ -244,6 +448,23 @@ index 0000000..43b6233 +custom: '0' +type: comment +locked: '1' +diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/Core/Entity/Comment.php b/core/modules/comment/lib/Drupal/comment/Plugin/Core/Entity/Comment.php +index 2b00d45..c2dd9f2 100644 +--- a/core/modules/comment/lib/Drupal/comment/Plugin/Core/Entity/Comment.php ++++ b/core/modules/comment/lib/Drupal/comment/Plugin/Core/Entity/Comment.php +@@ -33,12 +33,6 @@ + * "bundle" = "node_type", + * "label" = "subject", + * "uuid" = "uuid" +- * }, +- * view_modes = { +- * "full" = { +- * "label" = "Full comment", +- * "custom_settings" = FALSE +- * } + * } + * ) + */ diff --git a/core/modules/entity_ui/css/entity_ui.admin.css b/core/modules/entity_ui/css/entity_ui.admin.css new file mode 100644 index 0000000..53093a1 @@ -351,7 +572,7 @@ index 0000000..9d2b59c +configure = admin/config/system/view-modes diff --git a/core/modules/entity_ui/entity_ui.module b/core/modules/entity_ui/entity_ui.module new file mode 100644 -index 0000000..a43695a +index 0000000..03bc1a6 --- /dev/null +++ b/core/modules/entity_ui/entity_ui.module @@ -0,0 +1,120 @@ @@ -405,8 +626,8 @@ index 0000000..a43695a + */ +function entity_ui_entity_info_alter(&$entity_info) { + // Add a list and form controller for the view mode entity type. -+ $entity_info['view_mode']['list controller class'] = 'Drupal\entity_ui\ViewModeListController'; -+ $entity_info['view_mode']['form controller class'] = array( ++ $entity_info['view_mode']['list_controller_class'] = 'Drupal\entity_ui\ViewModeListController'; ++ $entity_info['view_mode']['form_controller_class'] = array( + 'default' => 'Drupal\entity_ui\ViewModeFormController', + ); +} @@ -757,7 +978,7 @@ index 0000000..f612d91 + +} diff --git a/core/modules/field_ui/field_ui.module b/core/modules/field_ui/field_ui.module -index 0e92ef0..87c7a50 100644 +index fd1bdc3..28fc056 100644 --- a/core/modules/field_ui/field_ui.module +++ b/core/modules/field_ui/field_ui.module @@ -1,9 +1,12 @@ @@ -784,23 +1005,23 @@ index 0000000..4746580 +custom: '0' +type: file +locked: '1' -diff --git a/core/modules/file/file.module b/core/modules/file/file.module -index 4e6c8eb..c008cb3 100644 ---- a/core/modules/file/file.module -+++ b/core/modules/file/file.module -@@ -102,12 +102,6 @@ function file_entity_info() { - 'label' => 'filename', - 'uuid' => 'uuid', - ), -- 'view modes' => array( -- 'full' => array( -- 'label' => t('File default'), -- 'custom settings' => FALSE, -- ), -- ), - 'static cache' => FALSE, - ), - ); +diff --git a/core/modules/file/lib/Drupal/file/Plugin/Core/Entity/File.php b/core/modules/file/lib/Drupal/file/Plugin/Core/Entity/File.php +index bc54514..d7f2a6b 100644 +--- a/core/modules/file/lib/Drupal/file/Plugin/Core/Entity/File.php ++++ b/core/modules/file/lib/Drupal/file/Plugin/Core/Entity/File.php +@@ -26,12 +26,6 @@ + * "id" = "fid", + * "label" = "filename", + * "uuid" = "uuid" +- * }, +- * view_modes = { +- * "full" = { +- * "label" = "File default", +- * "custom_settings" = FALSE +- * } + * } + * ) + */ diff --git a/core/modules/node/config/view_mode.node.full.yml b/core/modules/node/config/view_mode.node.full.yml new file mode 100644 index 0000000..0e667c5 @@ -834,47 +1055,49 @@ index 0000000..63efd07 +custom: '1' +type: node +locked: '1' +diff --git a/core/modules/node/lib/Drupal/node/Plugin/Core/Entity/Node.php b/core/modules/node/lib/Drupal/node/Plugin/Core/Entity/Node.php +index f161d81..c7ce4cc 100644 +--- a/core/modules/node/lib/Drupal/node/Plugin/Core/Entity/Node.php ++++ b/core/modules/node/lib/Drupal/node/Plugin/Core/Entity/Node.php +@@ -37,20 +37,6 @@ + * }, + * bundle_keys = { + * "bundle" = "type" +- * }, +- * view_modes = { +- * "full" = { +- * "label" = "Full content", +- * "custom_settings" = FALSE +- * }, +- * "teaser" = { +- * "label" = "Teaser", +- * "custom_settings" = TRUE +- * }, +- * "rss" = { +- * "label" = "RSS", +- * "custom_settings" = FALSE +- * } + * } + * ) + */ diff --git a/core/modules/node/node.module b/core/modules/node/node.module -index 55989de..ae33873 100644 +index a997a04..8815c4a 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module -@@ -218,20 +218,6 @@ function node_entity_info() { - ), - 'bundles' => array(), - 'render controller class' => 'Drupal\node\NodeRenderController', -- 'view modes' => array( -- 'full' => array( -- 'label' => t('Full content'), -- 'custom settings' => FALSE, -- ), -- 'teaser' => array( -- 'label' => t('Teaser'), -- 'custom settings' => TRUE, -- ), -- 'rss' => array( -- 'label' => t('RSS'), -- 'custom settings' => FALSE, -- ), -- ), - ), - ); - -@@ -240,21 +226,6 @@ function node_entity_info() { - $return['node']['translation']['node'] = TRUE; +@@ -199,19 +199,6 @@ function node_entity_info_alter(&$info) { + $info['node']['translation']['node'] = TRUE; } - // Search integration is provided by node.module, so search-related - // view modes for nodes are defined here and not in search.module. - if (module_exists('search')) { -- $return['node']['view modes'] += array( -- 'search_index' => array( -- 'label' => t('Search index'), -- 'custom settings' => FALSE, -- ), -- 'search_result' => array( -- 'label' => t('Search result'), -- 'custom settings' => FALSE, -- ), +- $info['node']['view_modes']['search_index'] = array( +- 'label' => t('Search index'), +- 'custom_settings' => FALSE, +- ); +- $info['node']['view_modes']['search_result'] = array( +- 'label' => t('Search result'), +- 'custom_settings' => FALSE, - ); - } - @@ -904,10 +1127,10 @@ index 0000000..da28216 +type: node +locked: '1' diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/FilledStandardUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/FilledStandardUpgradePathTest.php -index da4034b..654bea7 100644 +index e1df73e..4839a9c 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/FilledStandardUpgradePathTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/FilledStandardUpgradePathTest.php -@@ -86,5 +86,13 @@ public function testFilledStandardUpgrade() { +@@ -96,5 +96,13 @@ public function testFilledStandardUpgrade() { $blog_type = node_type_load('blog'); $this->assertEqual($blog_type->module, 'node', "Content type 'blog' has been reassigned from the blog module to the node module."); $this->assertEqual($blog_type->base, 'node_content', "The base string used to construct callbacks corresponding to content type 'Blog' has been reassigned to 'node_content'."); @@ -922,10 +1145,10 @@ index da4034b..654bea7 100644 } } diff --git a/core/modules/system/system.install b/core/modules/system/system.install -index d0deae1..9f6c28a 100644 +index 4bced68..8256dcc 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install -@@ -2188,6 +2188,51 @@ function system_update_8030() { +@@ -2202,6 +2202,51 @@ function system_update_8032() { } /** @@ -933,7 +1156,7 @@ index d0deae1..9f6c28a 100644 + * + * @ingroup config_upgrade + */ -+function system_update_8031() { ++function system_update_8033() { + // We can't call entity_info() in an update hook, so we hardcode them. + // We only care about the core view modes as hook_entity_info_alter() will + // still work since that was the only way to add custom view modes in D7. @@ -977,41 +1200,6 @@ index d0deae1..9f6c28a 100644 * @} End of "defgroup updates-7.x-to-8.x". * The next series of updates should start at 9000. */ -diff --git a/core/modules/system/system.module b/core/modules/system/system.module -index ea3dadc..2a1809b 100644 ---- a/core/modules/system/system.module -+++ b/core/modules/system/system.module -@@ -1079,6 +1079,30 @@ function system_menu() { - } - - /** -+ * Implements hook_entity_info(). -+ */ -+function system_entity_info() { -+ // This entity type is provided on behalf of the entity system. -+ // @todo Remove from system module after http://drupal.org/node/1763974. -+ $return = array( -+ 'view_mode' => array( -+ 'label' => t('View mode'), -+ 'entity class' => 'Drupal\Core\Entity\ViewMode\EntityViewMode', -+ 'controller class' => 'Drupal\Core\Config\Entity\ConfigStorageController', -+ 'config prefix' => 'view_mode', -+ 'fieldable' => FALSE, -+ 'entity keys' => array( -+ 'id' => 'machine_name', -+ 'label' => 'name', -+ 'uuid' => 'uuid', -+ ), -+ ), -+ ); -+ -+ return $return; -+} -+ -+/** - * Page callback; Execute cron tasks. - * - * @see system_cron_access(). diff --git a/core/modules/taxonomy/config/view_mode.taxonomy_term.full.yml b/core/modules/taxonomy/config/view_mode.taxonomy_term.full.yml new file mode 100644 index 0000000..99dca2d @@ -1023,37 +1211,40 @@ index 0000000..99dca2d +custom: '0' +type: taxonomy_term +locked: '1' -diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module -index 874c78a..3d142b5 100644 ---- a/core/modules/taxonomy/taxonomy.module -+++ b/core/modules/taxonomy/taxonomy.module -@@ -131,13 +131,6 @@ function taxonomy_entity_info() { - ), - 'bundles' => array(), - 'render controller class' => 'Drupal\taxonomy\TermRenderController', -- 'view modes' => array( -- // @todo View mode for display as a field (when attached to nodes etc). -- 'full' => array( -- 'label' => t('Taxonomy term page'), -- 'custom settings' => FALSE, -- ), -- ), - ), - ); - foreach (taxonomy_vocabulary_get_names() as $machine_name => $vocabulary) { -@@ -164,12 +157,6 @@ function taxonomy_entity_info() { - 'label' => 'name', - ), - 'fieldable' => FALSE, -- 'view modes' => array( -- 'full' => array( -- 'label' => t('Taxonomy vocabulary default'), -- 'custom settings' => FALSE, -- ), -- ), - ); - - return $return; +diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/Core/Entity/Term.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/Core/Entity/Term.php +index 8aedeee..362617a 100644 +--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/Core/Entity/Term.php ++++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/Core/Entity/Term.php +@@ -35,12 +35,6 @@ + * }, + * bundle_keys = { + * "bundle" = "machine_name" +- * }, +- * view_modes = { +- * "full" = { +- * "label" = "Taxonomy term page", +- * "custom_settings" = FALSE +- * } + * } + * ) + */ +diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/Core/Entity/Vocabulary.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/Core/Entity/Vocabulary.php +index 0ecbae8..beee8d1 100644 +--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/Core/Entity/Vocabulary.php ++++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/Core/Entity/Vocabulary.php +@@ -26,12 +26,6 @@ + * entity_keys = { + * "id" = "vid", + * "label" = "name" +- * }, +- * view_modes = { +- * "full" = { +- * "label" = "Taxonomy vocabulary", +- * "custom_settings" = FALSE +- * } + * } + * ) + */ diff --git a/core/modules/user/config/view_mode.user.full.yml b/core/modules/user/config/view_mode.user.full.yml new file mode 100644 index 0000000..283935e @@ -1065,29 +1256,29 @@ index 0000000..283935e +custom: '0' +type: user +locked: '1' -diff --git a/core/modules/user/user.module b/core/modules/user/user.module -index c064427..454afd5 100644 ---- a/core/modules/user/user.module -+++ b/core/modules/user/user.module -@@ -169,12 +169,6 @@ function user_entity_info() { - ), - ), - 'render controller class' => 'Drupal\user\UserRenderController', -- 'view modes' => array( -- 'full' => array( -- 'label' => t('User account'), -- 'custom settings' => FALSE, -- ), -- ), - ), - ); - } +diff --git a/core/modules/user/lib/Drupal/user/Plugin/Core/Entity/User.php b/core/modules/user/lib/Drupal/user/Plugin/Core/Entity/User.php +index 68edca1..dd22246 100644 +--- a/core/modules/user/lib/Drupal/user/Plugin/Core/Entity/User.php ++++ b/core/modules/user/lib/Drupal/user/Plugin/Core/Entity/User.php +@@ -40,12 +40,6 @@ + * "access arguments" = {"administer users"} + * } + * } +- * }, +- * view_modes = { +- * "full" = { +- * "label" = "User account", +- * "custom_settings" = FALSE +- * } + * } + * ) + */ diff --git a/core/profiles/standard/standard.info b/core/profiles/standard/standard.info -index 8b8a33b..28db9c6 100644 +index 18136bc..04776ef 100644 --- a/core/profiles/standard/standard.info +++ b/core/profiles/standard/standard.info -@@ -22,3 +22,4 @@ dependencies[] = overlay - dependencies[] = field_ui - dependencies[] = file +@@ -24,3 +24,4 @@ dependencies[] = file dependencies[] = rdf + dependencies[] = views + dependencies[] = views_ui +dependencies[] = entity_ui