diff --git a/core/includes/menu.inc b/core/includes/menu.inc deleted file mode 100644 index 11c9f0781649e34704fbd81c61a7593129f4ddc8..0000000000000000000000000000000000000000 --- a/core/includes/menu.inc +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -/** - * @file - * API for the Drupal menu system. - */ - -/** - * @addtogroup menu - * @{ - */ - -/** - * Returns an array containing the names of system-defined (default) menus. - * - * @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use - * \Drupal\system\Entity\Menu::loadMultiple() instead. - * - * @see https://www.drupal.org/node/3027453 - */ -function menu_list_system_menus() { - @trigger_error(__FUNCTION__ . '() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal\system\Entity\Menu::loadMultiple() instead. See https://www.drupal.org/node/3027453', E_USER_DEPRECATED); - return [ - 'tools' => 'Tools', - 'admin' => 'Administration', - 'account' => 'User account menu', - 'main' => 'Main navigation', - 'footer' => 'Footer menu', - ]; -} - -/** - * @} End of "addtogroup menu". - */ diff --git a/core/includes/theme.inc b/core/includes/theme.inc index ff7052d4a8d8b231cce8f07a923f05856d0cb839..3a2a964fb8babd2ab3aef2bce51be4ccc553a6a6 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -2082,7 +2082,6 @@ function drupal_common_theme() { 'pager' => [ 'render element' => 'pager', ], - // From menu.inc. 'menu' => [ 'variables' => ['menu_name' => NULL, 'items' => [], 'attributes' => []], ], diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php index e23d81b15636f9709c7146b5cbf04d776ce1ee67..59f24ed7e96b00d589b6548f6c0214025caf0453 100644 --- a/core/lib/Drupal/Core/DrupalKernel.php +++ b/core/lib/Drupal/Core/DrupalKernel.php @@ -537,7 +537,6 @@ public function loadLegacyIncludes() { require_once $this->root . '/core/includes/common.inc'; require_once $this->root . '/core/includes/module.inc'; require_once $this->root . '/core/includes/theme.inc'; - require_once $this->root . '/core/includes/menu.inc'; require_once $this->root . '/core/includes/form.inc'; require_once $this->root . '/core/includes/errors.inc'; require_once $this->root . '/core/includes/schema.inc'; diff --git a/core/modules/book/src/BookManagerInterface.php b/core/modules/book/src/BookManagerInterface.php index 44107f2f9066dfa34f9c49e746cce0ec4bbb124e..e6f9c6f55d5af8ff04548c9a1f35ddcd9cb938d2 100644 --- a/core/modules/book/src/BookManagerInterface.php +++ b/core/modules/book/src/BookManagerInterface.php @@ -133,9 +133,6 @@ public function bookTreeCollectNodeLinks(&$tree, &$node_links); /** * Provides book loading, access control and translation. * - * Note: copied from _menu_link_translate() in menu.inc, but reduced to the - * minimal code that's used. - * * @param array $link * A book link. */ diff --git a/core/modules/menu_ui/menu_ui.module b/core/modules/menu_ui/menu_ui.module index ad49bf10f7011cc8cfc3ae371f549fbb72f4f7bb..b3d620d5461987de69c6fc4b8504e00beb14b535 100644 --- a/core/modules/menu_ui/menu_ui.module +++ b/core/modules/menu_ui/menu_ui.module @@ -423,36 +423,6 @@ function menu_ui_form_node_type_form_builder($entity_type, NodeTypeInterface $ty $type->setThirdPartySetting('menu_ui', 'parent', $form_state->getValue('menu_parent')); } -/** - * Return an associative array of the custom menus names. - * - * @param bool $all - * (optional) If FALSE return only user-added menus, or if TRUE also include - * the menus defined by the system. Defaults to TRUE. - * - * @return array - * An array with the machine-readable names as the keys, and human-readable - * titles as the values. - * - * @deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use - * \Drupal\system\Entity\Menu::loadMultiple() instead. - * - * @see https://www.drupal.org/node/3027453 - */ -function menu_ui_get_menus($all = TRUE) { - @trigger_error(__FUNCTION__ . '() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal\system\Entity\Menu::loadMultiple() instead. See https://www.drupal.org/node/3027453', E_USER_DEPRECATED); - if ($custom_menus = Menu::loadMultiple()) { - if (!$all) { - $custom_menus = array_diff_key($custom_menus, menu_list_system_menus()); - } - foreach ($custom_menus as $menu_name => $menu) { - $custom_menus[$menu_name] = $menu->label(); - } - asort($custom_menus); - } - return $custom_menus; -} - /** * Implements hook_preprocess_HOOK() for block templates. */ diff --git a/core/tests/Drupal/KernelTests/Core/Menu/MenuLegacyTest.php b/core/tests/Drupal/KernelTests/Core/Menu/MenuLegacyTest.php deleted file mode 100644 index 33f203e4a5b65fd3617e5c7b6ea9bfe81cad30eb..0000000000000000000000000000000000000000 --- a/core/tests/Drupal/KernelTests/Core/Menu/MenuLegacyTest.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php - -namespace Drupal\KernelTests\Core\Menu; - -use Drupal\KernelTests\KernelTestBase; - -/** - * Deprecation test cases for the menu layer. - * - * @group legacy - */ -class MenuLegacyTest extends KernelTestBase { - - /** - * {@inheritdoc} - */ - protected static $modules = ['menu_ui', 'system', 'user']; - - /** - * {@inheritdoc} - */ - protected function setUp(): void { - parent::setUp(); - $this->installConfig('system'); - } - - /** - * Tests deprecation of the menu_list_system_menus() function. - */ - public function testListSystemMenus(): void { - $this->expectDeprecation('menu_list_system_menus() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal\system\Entity\Menu::loadMultiple() instead. See https://www.drupal.org/node/3027453'); - $this->assertSame([ - 'tools' => 'Tools', - 'admin' => 'Administration', - 'account' => 'User account menu', - 'main' => 'Main navigation', - 'footer' => 'Footer menu', - ], menu_list_system_menus()); - } - - /** - * Tests deprecation of the menu_ui_get_menus() function. - */ - public function testMenuUiGetMenus(): void { - $this->expectDeprecation('menu_ui_get_menus() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal\system\Entity\Menu::loadMultiple() instead. See https://www.drupal.org/node/3027453'); - $this->assertSame([ - 'admin' => 'Administration', - 'footer' => 'Footer', - 'main' => 'Main navigation', - 'tools' => 'Tools', - 'account' => 'User account menu', - ], menu_ui_get_menus()); - } - -}