diff --git a/core/modules/entity/entity.module b/core/modules/entity/entity.module index a88a10a..8b70c47 100644 --- a/core/modules/entity/entity.module +++ b/core/modules/entity/entity.module @@ -30,10 +30,7 @@ function entity_menu() { $items['admin/structure/display-modes'] = array( 'title' => 'Display modes', 'description' => 'Configure what displays are available for your content and forms.', - 'page callback' => 'system_admin_menu_block_page', - 'access arguments' => array('administer display modes'), - 'file' => 'system.admin.inc', - 'file path' => drupal_get_path('module', 'system'), + 'route_name' => 'entity_display_mode', ); // View modes. diff --git a/core/modules/entity/entity.routing.yml b/core/modules/entity/entity.routing.yml index 05d7092..6ef9fd9 100644 --- a/core/modules/entity/entity.routing.yml +++ b/core/modules/entity/entity.routing.yml @@ -1,3 +1,10 @@ +entity_display_mode: + pattern: '/admin/structure/display-modes' + defaults: + _content: '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage' + requirements: + _permission: 'administer display modes' + entity_view_mode.list: pattern: '/admin/structure/display-modes/view' defaults: diff --git a/core/modules/system/lib/Drupal/system/Controller/SystemController.php b/core/modules/system/lib/Drupal/system/Controller/SystemController.php index bb54df6..af212c8 100644 --- a/core/modules/system/lib/Drupal/system/Controller/SystemController.php +++ b/core/modules/system/lib/Drupal/system/Controller/SystemController.php @@ -96,11 +96,9 @@ public function overview() { unset($item['localized_options']['attributes']['title']); } $block = $item; - // @todo Replace system_admin_menu_block() in - // https://drupal.org/node/1987814. $block['content'] = array( '#theme' => 'admin_block_content', - '#content' => system_admin_menu_block($item), + '#content' => $this->systemManager->getAdminBlock($item), ); if (!empty($block['content'])) { diff --git a/core/modules/system/system.module b/core/modules/system/system.module index dc0e4db..1db7d5b 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -2300,18 +2300,6 @@ function system_preprocess_block(&$variables) { } /** - * Provide a single block on the administration overview page. - * - * @param $item - * The menu item to be displayed. - * - * @deprecated Use \Drupal\system\SystemManager::getAdminBlock(). - */ -function system_admin_menu_block($item) { - return Drupal::service('system.manager')->getAdminBlock($item); -} - -/** * Checks the existence of the directory specified in $form_element. * * This function is called from the system_settings form to check all core