990c990 < index 35cdc19..e282315 100644 --- > index 2fd5929..604c110 100644 993c993 < @@ -393,7 +393,7 @@ function aggregator_save_category($edit) { --- > @@ -391,7 +391,7 @@ function aggregator_save_category($edit) { 1029c1029 < index 99edfc5..6c698ca 100644 --- > index af436d4..e2cec99 100644 1632c1632 < index 3d4a360..8ea85c8 100644 --- > index 6acb232..1ff17df 100644 1635c1635 < @@ -15,6 +15,8 @@ --- > @@ -16,6 +16,8 @@ 1644c1644 < @@ -113,9 +115,9 @@ function menu_menu() { --- > @@ -114,9 +116,9 @@ function menu_menu() { 1657c1657 < @@ -138,21 +140,20 @@ function menu_menu() { --- > @@ -139,21 +141,20 @@ function menu_menu() { 1683c1683 < @@ -202,23 +203,29 @@ function menu_theme() { --- > @@ -203,23 +204,29 @@ function menu_theme() { 1728c1728 < @@ -299,24 +306,26 @@ function menu_menu_delete(Menu $menu) { --- > @@ -301,24 +308,26 @@ function menu_menu_delete(Menu $menu) { 1765c1765 < @@ -325,14 +334,12 @@ function menu_parent_options($menus, $item, $type = '') { --- > @@ -327,14 +336,12 @@ function menu_parent_options($menus, $item, $type = '') { 1785c1785 < @@ -344,7 +351,7 @@ function menu_parent_options($menus, $item, $type = '') { --- > @@ -346,7 +353,7 @@ function menu_parent_options($menus, $item, $type = '') { 1794c1794 < @@ -409,26 +416,6 @@ function _menu_parents_recurse($tree, $menu_name, $indent, &$options, $exclude, --- > @@ -411,26 +418,6 @@ function _menu_parents_recurse($tree, $menu_name, $indent, &$options, $exclude, 1820,1821c1820,1821 < function menu_block_view_alter(&$build, $block) { < @@ -461,7 +448,7 @@ function menu_node_save(Node $node) { --- > function menu_block_view_alter(array &$build, Block $block) { > @@ -463,7 +450,7 @@ function menu_node_save(Node $node) { 1830c1830 < @@ -488,9 +475,13 @@ function menu_node_save(Node $node) { --- > @@ -490,9 +477,13 @@ function menu_node_save(Node $node) { 1847c1847 < @@ -501,42 +492,48 @@ function menu_node_prepare(Node $node) { --- > @@ -503,42 +494,48 @@ function menu_node_prepare(Node $node) { 1919c1919 < @@ -548,7 +545,7 @@ function menu_node_prepare(Node $node) { --- > @@ -550,7 +547,7 @@ function menu_node_prepare(Node $node) { 1928c1928 < @@ -564,10 +561,7 @@ function menu_form_node_form_alter(&$form, $form_state) { --- > @@ -566,10 +563,7 @@ function menu_form_node_form_alter(&$form, $form_state) { 1940c1940 < @@ -639,13 +633,7 @@ function menu_form_node_form_alter(&$form, $form_state) { --- > @@ -641,13 +635,7 @@ function menu_form_node_form_alter(&$form, $form_state) { 1955c1955 < @@ -665,6 +653,7 @@ function menu_form_node_form_alter(&$form, $form_state) { --- > @@ -667,6 +655,7 @@ function menu_form_node_form_alter(&$form, $form_state) { 1963c1963 < @@ -701,7 +690,8 @@ function menu_form_node_type_form_alter(&$form, $form_state) { --- > @@ -703,7 +692,8 @@ function menu_form_node_type_form_alter(&$form, $form_state) { 3773c3773 < index 9c51a89..8675066 100644 --- > index dcf53b0..fb104ac 100644 3776c3776 < @@ -207,13 +207,13 @@ function testBreadCrumbs() { --- > @@ -209,13 +209,13 @@ function testBreadCrumbs() { 3792c3792 < @@ -235,13 +235,13 @@ function testBreadCrumbs() { --- > @@ -237,13 +237,13 @@ function testBreadCrumbs() { 3808c3808 < @@ -275,7 +275,8 @@ function testBreadCrumbs() { --- > @@ -277,7 +277,8 @@ function testBreadCrumbs() { 3818c3818 < @@ -333,10 +334,8 @@ function testBreadCrumbs() { --- > @@ -335,10 +336,8 @@ function testBreadCrumbs() { 3831c3831 < @@ -434,20 +433,16 @@ function testBreadCrumbs() { --- > @@ -436,20 +435,16 @@ function testBreadCrumbs() { 3912,4012c3912,3916 < diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/RouterTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/RouterTest.php < index 56d2551..b47559e 100644 < --- a/core/modules/system/lib/Drupal/system/Tests/Menu/RouterTest.php < +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/RouterTest.php < @@ -312,27 +312,30 @@ function testMenuName() { < $admin_user = $this->drupalCreateUser(array('administer site configuration')); < $this->drupalLogin($admin_user); < < - $sql = "SELECT menu_name FROM {menu_links} WHERE router_path = 'menu_name_test'"; < - $name = db_query($sql)->fetchField(); < - $this->assertEqual($name, 'original', 'Menu name is "original".'); < + $menu_links = entity_load_multiple_by_properties('menu_link', array('router_path' => 'menu_name_test')); < + $menu_link = reset($menu_links); < + $this->assertEqual($menu_link->menu_name, 'original', 'Menu name is "original".'); < < // Change the menu_name parameter in menu_test.module, then force a menu < // rebuild. < menu_test_menu_name('changed'); < menu_router_rebuild(); < < - $sql = "SELECT menu_name FROM {menu_links} WHERE router_path = 'menu_name_test'"; < - $name = db_query($sql)->fetchField(); < - $this->assertEqual($name, 'changed', 'Menu name was successfully changed after rebuild.'); < + $menu_links = entity_load_multiple_by_properties('menu_link', array('router_path' => 'menu_name_test')); < + $menu_link = reset($menu_links); < + $this->assertEqual($menu_link->menu_name, 'changed', 'Menu name was successfully changed after rebuild.'); < } < < /** < * Tests for menu hierarchy. < */ < function testMenuHierarchy() { < - $parent_link = db_query('SELECT * FROM {menu_links} WHERE link_path = :link_path', array(':link_path' => 'menu-test/hierarchy/parent'))->fetchAssoc(); < - $child_link = db_query('SELECT * FROM {menu_links} WHERE link_path = :link_path', array(':link_path' => 'menu-test/hierarchy/parent/child'))->fetchAssoc(); < - $unattached_child_link = db_query('SELECT * FROM {menu_links} WHERE link_path = :link_path', array(':link_path' => 'menu-test/hierarchy/parent/child2/child'))->fetchAssoc(); < + $parent_links = entity_load_multiple_by_properties('menu_link', array('link_path' => 'menu-test/hierarchy/parent')); < + $parent_link = reset($parent_links); < + $child_links = entity_load_multiple_by_properties('menu_link', array('link_path' => 'menu-test/hierarchy/parent/child')); < + $child_link = reset($child_links); < + $unattached_child_links = entity_load_multiple_by_properties('menu_link', array('link_path' => 'menu-test/hierarchy/parent/child2/child')); < + $unattached_child_link = reset($unattached_child_links); < < $this->assertEqual($child_link['plid'], $parent_link['mlid'], 'The parent of a directly attached child is correct.'); < $this->assertEqual($unattached_child_link['plid'], $parent_link['mlid'], 'The parent of a non-directly attached child is correct.'); < @@ -343,12 +346,16 @@ function testMenuHierarchy() { < */ < function testMenuHidden() { < // Verify links for one dynamic argument. < - $links = db_select('menu_links', 'ml') < - ->fields('ml') < - ->condition('ml.router_path', 'menu-test/hidden/menu%', 'LIKE') < - ->orderBy('ml.router_path') < - ->execute() < - ->fetchAllAssoc('router_path', PDO::FETCH_ASSOC); < + $query = entity_query('menu_link') < + ->condition('router_path', 'menu-test/hidden/menu', 'STARTS_WITH') < + ->sort('router_path'); < + $result = $query->execute(); < + $menu_links = menu_link_load_multiple($result); < + < + $links = array(); < + foreach ($menu_links as $menu_link) { < + $links[$menu_link->router_path] = $menu_link; < + } < < $parent = $links['menu-test/hidden/menu']; < $depth = $parent['depth'] + 1; < @@ -391,12 +398,16 @@ function testMenuHidden() { < $this->assertEqual($link['plid'], $plid, format_string('%path plid @link_plid is equal to @plid.', array('%path' => $link['router_path'], '@link_plid' => $link['plid'], '@plid' => $plid))); < < // Verify links for two dynamic arguments. < - $links = db_select('menu_links', 'ml') < - ->fields('ml') < - ->condition('ml.router_path', 'menu-test/hidden/block%', 'LIKE') < - ->orderBy('ml.router_path') < - ->execute() < - ->fetchAllAssoc('router_path', PDO::FETCH_ASSOC); < + $query = entity_query('menu_link') < + ->condition('router_path', 'menu-test/hidden/block', 'STARTS_WITH') < + ->sort('router_path'); < + $result = $query->execute(); < + $menu_links = menu_link_load_multiple($result); < + < + $links = array(); < + foreach ($menu_links as $menu_link) { < + $links[$menu_link->router_path] = $menu_link; < + } < < $parent = $links['menu-test/hidden/block']; < $depth = $parent['depth'] + 1; < @@ -472,7 +483,7 @@ function testMenuItemHooks() { < */ < function testMenuLinkOptions() { < // Create a menu link with options. < - $menu_link = array( < + $menu_link = entity_create('menu_link', array( < 'link_title' => 'Menu link options test', < 'link_path' => 'test-page', < 'module' => 'menu_test', < @@ -484,7 +495,7 @@ function testMenuLinkOptions() { < 'testparam' => 'testvalue', --- > diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php > index 35d23e8..e33b15c 100644 > --- a/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php > +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php > @@ -485,7 +485,7 @@ function testMenuLinkOptions() { 4015,4017c3919,3921 < - ); < + )); < menu_link_save($menu_link); --- > ); > - menu_link_save($menu_link); > + menu_link_save((\Drupal\menu_link\Plugin\Core\Entity\MenuLink)$menu_link); 4019a3924 > $this->drupalGet('test-page'); 4293c4198 < index ca5d6de..0f96475 100644 --- > index b63ca46..baf4c0b 100644 4533c4438 < index e80a7df..143034e 100644 --- > index 336f84b..fe3fec4 100644 4536c4441 < @@ -2666,7 +2666,10 @@ function system_admin_menu_block($item) { --- > @@ -2673,7 +2673,10 @@ function system_admin_menu_block($item) { 4548c4453 < @@ -2674,17 +2677,8 @@ function system_admin_menu_block($item) { --- > @@ -2681,17 +2684,8 @@ function system_admin_menu_block($item) { 4568c4473 < @@ -3449,18 +3443,8 @@ function system_get_module_admin_tasks($module, $info) { --- > @@ -3456,18 +3450,8 @@ function system_get_module_admin_tasks($module, $info) { 4589c4494 < @@ -3512,6 +3496,7 @@ function system_get_module_admin_tasks($module, $info) { --- > @@ -3519,6 +3503,7 @@ function system_get_module_admin_tasks($module, $info) { 4629c4534 < index 02f5072..42c0622 100644 --- > index 747758d..d70031c 100644 4669c4574 < index 05a42a4..96a829a 100644 --- > index d329414..a93cbe1 100644 4681c4586 < index 6b6a8e8..d3c6b03 100644 --- > index f22afbe..6b74ddd 100644 4693c4598 < index d497954..6645aed 100644 --- > index ee58a3b..d023554 100644 4705c4610 < index 65c71e5..4602203 100644 --- > index 0e9887a..c5f27f6 100644 4729c4634 < index 5cb8fb3..045fd70 100644 --- > index c360fd1..5694d56 100644 4732c4637 < @@ -298,11 +298,11 @@ function standard_install() { --- > @@ -241,11 +241,11 @@ function standard_install() { 4746c4651 < @@ -312,16 +312,16 @@ function standard_install() { --- > @@ -255,16 +255,16 @@ function standard_install() {