diff --git a/core/lib/Drupal/Core/Entity/Entity.php b/core/lib/Drupal/Core/Entity/Entity.php index 403945db30e60aac473823b882255be0ddfe0747..e89ce3164de3c3419562edc10abb19e50f45509a 100644 --- a/core/lib/Drupal/Core/Entity/Entity.php +++ b/core/lib/Drupal/Core/Entity/Entity.php @@ -309,9 +309,6 @@ protected function urlRouteParameters($rel) { if ($rel === 'revision' && $this instanceof RevisionableInterface) { $uri_route_parameters[$this->getEntityTypeId() . '_revision'] = $this->getRevisionId(); } - if ($rel === 'uuid') { - $uri_route_parameters[$this->getEntityTypeId()] = $this->uuid(); - } return $uri_route_parameters; } diff --git a/core/lib/Drupal/Core/Entity/Routing/DefaultHtmlRouteProvider.php b/core/lib/Drupal/Core/Entity/Routing/DefaultHtmlRouteProvider.php index a1958ffeb3eedcbe23050593c9ef6246ab3087fd..b1f6abd234c2add41590041b9e1e0bd832d7ad26 100644 --- a/core/lib/Drupal/Core/Entity/Routing/DefaultHtmlRouteProvider.php +++ b/core/lib/Drupal/Core/Entity/Routing/DefaultHtmlRouteProvider.php @@ -2,7 +2,6 @@ namespace Drupal\Core\Entity\Routing; -use Drupal\Component\Uuid\Uuid; use Drupal\Core\Config\Entity\ConfigEntityTypeInterface; use Drupal\Core\Entity\Controller\EntityController; use Drupal\Core\Entity\EntityFieldManagerInterface; @@ -24,7 +23,6 @@ * - add-form * - edit-form * - delete-form - * - uuid * * @see \Drupal\Core\Entity\Routing\AdminHtmlRouteProvider. * @@ -85,12 +83,6 @@ public function getRoutes(EntityTypeInterface $entity_type) { $collection->add("entity.{$entity_type_id}.add_form", $add_form_route); } - // This goes before canonical because the UUID pattern must be tested before - // non-integer entity IDs. - if ($uuid_route = $this->getUuidRoute($entity_type)) { - $collection->add("entity.{$entity_type_id}.uuid", $uuid_route); - } - if ($canonical_route = $this->getCanonicalRoute($entity_type)) { $collection->add("entity.{$entity_type_id}.canonical", $canonical_route); } @@ -237,34 +229,6 @@ protected function getCanonicalRoute(EntityTypeInterface $entity_type) { } } - /** - * Gets the UUID route. - * - * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type - * The entity type. - * - * @return \Symfony\Component\Routing\Route|null - * The generated route, if available. - */ - protected function getUuidRoute(EntityTypeInterface $entity_type) { - if ($entity_type->getKey('uuid') && $entity_type->hasViewBuilderClass() && $entity_type->hasLinkTemplate('uuid')) { - $entity_type_id = $entity_type->id(); - $route = new Route($entity_type->getLinkTemplate('uuid')); - $route - ->addDefaults([ - '_entity_view' => $entity_type_id . '.full', - '_title_callback' => '\Drupal\Core\Entity\Controller\EntityController::title', - ]) - ->setRequirement('_entity_access', $entity_type_id . '.view') - ->setOption('parameters', [ - $entity_type_id => ['type' => 'entity:' . $entity_type_id], - ]) - // Set requirement for UUID pattern. - ->setRequirement($entity_type_id, '^' . Uuid::VALID_PATTERN . '$'); - return $route; - } - } - /** * Gets the edit-form route. * diff --git a/core/lib/Drupal/Core/Menu/DefaultMenuLinkTreeManipulators.php b/core/lib/Drupal/Core/Menu/DefaultMenuLinkTreeManipulators.php index 8cb6795f7396402a68364b6003ba11164dde6953..43c4468286c69611b817b4e980f0fb809cb7a170 100644 --- a/core/lib/Drupal/Core/Menu/DefaultMenuLinkTreeManipulators.php +++ b/core/lib/Drupal/Core/Menu/DefaultMenuLinkTreeManipulators.php @@ -132,14 +132,10 @@ public function checkNodeAccess(array $tree) { $node_links = array(); $this->collectNodeLinks($tree, $node_links); if ($node_links) { - // These could be serial node IDs or UUIDs. - $node_identifiers = array_keys($node_links); + $nids = array_keys($node_links); $query = $this->queryFactory->get('node'); - $group = $query->orConditionGroup() - ->condition('nid', $node_identifiers, 'IN') - ->condition('uuid', $node_identifiers, 'IN'); - $query->condition($group); + $query->condition('nid', $nids, 'IN'); // Allows admins to view all nodes, by both disabling node_access // query rewrite as well as not checking for the node status. The @@ -154,13 +150,10 @@ public function checkNodeAccess(array $tree) { $query->condition('status', NODE_PUBLISHED); } - // Cast to an array so we can loop, even if there are no results. - $nids = (array) $query->execute(); + $nids = $query->execute(); foreach ($nids as $nid) { - if (isset($node_links[$nid])) { - foreach ($node_links[$nid] as $key => $link) { - $node_links[$nid][$key]->access = $access_result; - } + foreach ($node_links[$nid] as $key => $link) { + $node_links[$nid][$key]->access = $access_result; } } } @@ -181,7 +174,7 @@ public function checkNodeAccess(array $tree) { */ protected function collectNodeLinks(array &$tree, array &$node_links) { foreach ($tree as $key => &$element) { - if (in_array($element->link->getRouteName(), ['entity.node.canonical', 'entity.node.uuid'], TRUE)) { + if ($element->link->getRouteName() == 'entity.node.canonical') { $nid = $element->link->getRouteParameters()['node']; $node_links[$nid][$key] = $element; // Deny access by default. checkNodeAccess() will re-add it. diff --git a/core/lib/Drupal/Core/ParamConverter/EntityConverter.php b/core/lib/Drupal/Core/ParamConverter/EntityConverter.php index 91ed0ece1aa163f7c57c1b6d1c4594efae5b6555..573cd49e780b7aa5eca2cd1622202be748ad209e 100644 --- a/core/lib/Drupal/Core/ParamConverter/EntityConverter.php +++ b/core/lib/Drupal/Core/ParamConverter/EntityConverter.php @@ -2,14 +2,13 @@ namespace Drupal\Core\ParamConverter; -use Drupal\Component\Uuid\Uuid; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\TypedData\TranslatableInterface; use Symfony\Component\Routing\Route; /** - * Parameter converter for upcasting entity IDs or UUIDs to full objects. + * Parameter converter for upcasting entity IDs to full objects. * * This is useful in cases where the dynamic elements of the path can't be * auto-determined; for example, if your path refers to multiple of the same @@ -58,19 +57,11 @@ public function __construct(EntityManagerInterface $entity_manager) { /** * {@inheritdoc} - * - * The value here can be either a serial entity ID, or the entity UUID. */ public function convert($value, $definition, $name, array $defaults) { $entity_type_id = $this->getEntityTypeFromDefaults($definition, $name, $defaults); if ($storage = $this->entityManager->getStorage($entity_type_id)) { $entity = $storage->load($value); - // If there is no entity loadable by ID, try to load by UUID. - if (!$entity && Uuid::isValid($value)) { - if ($entities = $storage->loadByProperties(['uuid' => $value])) { - $entity = reset($entities); - } - } // If the entity type is translatable, ensure we return the proper // translation object for the current context. if ($entity instanceof EntityInterface && $entity instanceof TranslatableInterface) { diff --git a/core/lib/Drupal/Core/Url.php b/core/lib/Drupal/Core/Url.php index a37627ed11a19c3f3ce3935128f4a602f42c9dcd..6a58319e026276673bd34ee807d49d31477f9da9 100644 --- a/core/lib/Drupal/Core/Url.php +++ b/core/lib/Drupal/Core/Url.php @@ -3,7 +3,6 @@ namespace Drupal\Core; use Drupal\Component\Utility\UrlHelper; -use Drupal\Component\Uuid\Uuid; use Drupal\Core\DependencyInjection\DependencySerializationTrait; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Routing\UrlGeneratorInterface; @@ -326,7 +325,7 @@ public static function fromUri($uri, $options = []) { * * @param array $uri_parts * Parts from an URI of the form entity:{entity_type}/{entity_id} as from - * parse_url(). Note that {entity_id} can be both a UUID and a serial ID. + * parse_url(). * @param array $options * An array of options, see \Drupal\Core\Url::fromUri() for details. * @param string $uri @@ -341,15 +340,10 @@ public static function fromUri($uri, $options = []) { protected static function fromEntityUri(array $uri_parts, array $options, $uri) { list($entity_type_id, $entity_id) = explode('/', $uri_parts['path'], 2); if ($uri_parts['scheme'] != 'entity' || $entity_id === '') { - throw new \InvalidArgumentException("The entity URI '$uri' is invalid. You must specify the entity id in the URL. e.g., entity:node/1 or entity:node/{uuid} for loading the canonical path to node entity with id 1."); - } - $route_name = "entity.$entity_type_id.canonical"; - if (Uuid::isValid($entity_id)) { - // UUID instead of entity ID. - $route_name = "entity.$entity_type_id.uuid"; + throw new \InvalidArgumentException("The entity URI '$uri' is invalid. You must specify the entity id in the URL. e.g., entity:node/1 for loading the canonical path to node entity with id 1."); } - return new static($route_name, [$entity_type_id => $entity_id], $options); + return new static("entity.$entity_type_id.canonical", [$entity_type_id => $entity_id], $options); } /** diff --git a/core/modules/aggregator/src/Entity/Feed.php b/core/modules/aggregator/src/Entity/Feed.php index e997e68a3765ed1897c7e1dc309791ae4f487e3b..834a55e9a85e9187c6e1a1593c692196ba77a686 100644 --- a/core/modules/aggregator/src/Entity/Feed.php +++ b/core/modules/aggregator/src/Entity/Feed.php @@ -31,7 +31,6 @@ * }, * links = { * "canonical" = "/aggregator/sources/{aggregator_feed}", - * "uuid" = "/aggregator/sources/{aggregator_feed}", * "edit-form" = "/aggregator/sources/{aggregator_feed}/configure", * "delete-form" = "/aggregator/sources/{aggregator_feed}/delete", * }, diff --git a/core/modules/menu_ui/menu_ui.module b/core/modules/menu_ui/menu_ui.module index d829580784c6a25e417e060552f785f396038c35..d642247f5662f235770b068a41c8fbdba7c30f60 100644 --- a/core/modules/menu_ui/menu_ui.module +++ b/core/modules/menu_ui/menu_ui.module @@ -201,13 +201,8 @@ function menu_ui_get_menu_link_defaults(NodeInterface $node) { // Give priority to the default menu $type_menus = $node_type->getThirdPartySetting('menu_ui', 'available_menus', array('main')); if (in_array($menu_name, $type_menus)) { - $query = \Drupal::entityQuery('menu_link_content'); - $group = $query->orConditionGroup() - ->condition('link.uri', 'entity:node/' . $node->id()) - ->condition('link.uri', 'entity:node/' . $node->uuid()) - ->condition('link.uri', 'internal:/node/' . $node->id()) - ->condition('link.uri', 'internal:/node/' . $node->uuid()); - $query->condition($group) + $query = \Drupal::entityQuery('menu_link_content') + ->condition('link.uri', 'node/' . $node->id()) ->condition('menu_name', $menu_name) ->sort('id', 'ASC') ->range(0, 1); @@ -217,13 +212,8 @@ function menu_ui_get_menu_link_defaults(NodeInterface $node) { } // Check all allowed menus if a link does not exist in the default menu. if (!$id && !empty($type_menus)) { - $query = \Drupal::entityQuery('menu_link_content'); - $group = $query->orConditionGroup() + $query = \Drupal::entityQuery('menu_link_content') ->condition('link.uri', 'entity:node/' . $node->id()) - ->condition('link.uri', 'entity:node/' . $node->uuid()) - ->condition('link.uri', 'internal:/node/' . $node->id()) - ->condition('link.uri', 'internal:/node/' . $node->uuid()); - $query->condition($group) ->condition('menu_name', array_values($type_menus), 'IN') ->sort('id', 'ASC') ->range(0, 1); diff --git a/core/modules/menu_ui/src/Tests/MenuNodeTest.php b/core/modules/menu_ui/src/Tests/MenuNodeTest.php index a6d7f18803368812aff7ecfef6e6f2bc62a91534..3fc8423fefb51cef0499d95a3b5e817dd1ec766d 100644 --- a/core/modules/menu_ui/src/Tests/MenuNodeTest.php +++ b/core/modules/menu_ui/src/Tests/MenuNodeTest.php @@ -2,8 +2,7 @@ namespace Drupal\menu_ui\Tests; -use Drupal\Core\Url; -use Drupal\node\Entity\NodeType; +use Drupal\simpletest\WebTestBase; use Drupal\language\Entity\ConfigurableLanguage; use Drupal\menu_link_content\Entity\MenuLinkContent; use Drupal\node\Entity\Node; @@ -13,7 +12,7 @@ * * @group menu_ui */ -class MenuNodeTest extends MenuWebTestBase { +class MenuNodeTest extends WebTestBase { /** * An editor user. @@ -339,38 +338,4 @@ function testMultilingualMenuNodeFormWidget() { $this->assertFieldById('edit-menu-title', $translated_node_title); } - /** - * Tests adding links to nodes using the /node/{uuid} format. - */ - public function testNodeUuidLink() { - /* @var \Drupal\node\NodeTypeInterface $type */ - $type = NodeType::load('page'); - // Enable the main menu for this node type.. - $menu_name = 'main'; - $type->setThirdPartySetting('menu_ui', 'available_menus', [$menu_name]); - $type->save(); - // Test links using node/{uuid}. - $node6 = $this->drupalCreateNode(array('type' => 'page')); - $uuid_link = $this->addMenuLink('', '/node/' . $node6->uuid(), $menu_name); - $this->verifyMenuLink($uuid_link, $node6); - $this->drupalGet($node6->url('edit-form')); - $this->assertFieldByName('menu[title]', $uuid_link->label()); - $this->drupalPostForm(NULL, [], t('Save')); - \Drupal::entityManager()->getStorage('menu_link_content')->resetCache([$uuid_link->id()]); - /** @var \Drupal\menu_link_content\MenuLinkContentInterface $uuid_link */ - $uuid_link = MenuLinkContent::load($uuid_link->id()); - $this->assertEqual($uuid_link->getUrlObject(), Url::fromUri('internal:/node/' . $node6->uuid())); - // Test with entity:node/{uuid}. - $node7 = $this->drupalCreateNode(array('type' => 'page')); - $uuid_link = $this->addMenuLink('', 'entity:node/' . $node7->uuid(), $menu_name); - $this->verifyMenuLink($uuid_link, $node7); - $this->drupalGet($node7->url('edit-form')); - $this->assertFieldByName('menu[title]', $uuid_link->label()); - $this->drupalPostForm(NULL, [], t('Save')); - \Drupal::entityManager()->getStorage('menu_link_content')->resetCache([$uuid_link->id()]); - /** @var \Drupal\menu_link_content\MenuLinkContentInterface $uuid_link */ - $uuid_link = MenuLinkContent::load($uuid_link->id()); - $this->assertEqual($uuid_link->getUrlObject(), Url::fromUri('entity:node/' . $node7->uuid())); - } - } diff --git a/core/modules/menu_ui/src/Tests/MenuTest.php b/core/modules/menu_ui/src/Tests/MenuTest.php index 016cca7ae2f81b096a89511d2282d285c54bf33a..f640cc749a6c4130db66ee14b8cecbd59a273b33 100644 --- a/core/modules/menu_ui/src/Tests/MenuTest.php +++ b/core/modules/menu_ui/src/Tests/MenuTest.php @@ -69,7 +69,7 @@ protected function setUp() { $this->drupalCreateContentType(array('type' => 'article', 'name' => 'Article')); // Create users. - $this->adminUser = $this->drupalCreateUser(array('access administration pages', 'administer blocks', 'administer menu', 'create article content', 'edit any article content')); + $this->adminUser = $this->drupalCreateUser(array('access administration pages', 'administer blocks', 'administer menu', 'create article content')); $this->authenticatedUser = $this->drupalCreateUser(array()); } @@ -221,7 +221,6 @@ function addCustomMenu() { // Enable the block. $block = $this->drupalPlaceBlock('system_menu_block:' . $menu_name); $this->blockPlacements[$menu_name] = $block->id(); - return Menu::load($menu_name); } @@ -583,6 +582,55 @@ public function testBlockContextualLinks() { $this->assertIdentical($json[$id], '<ul class="contextual-links"><li class="block-configure"><a href="' . base_path() . 'admin/structure/block/manage/' . $block->id() . '">Configure block</a></li><li class="entitymenuedit-form"><a href="' . base_path() . 'admin/structure/menu/manage/' . $custom_menu->id() . '">Edit menu</a></li></ul>'); } + /** + * Adds a menu link using the UI. + * + * @param string $parent + * Optional parent menu link id. + * @param string $path + * The path to enter on the form. Defaults to the front page. + * @param string $menu_name + * Menu name. Defaults to 'tools'. + * @param bool $expanded + * Whether or not this menu link is expanded. Setting this to TRUE should + * test whether it works when we do the authenticatedUser tests. Defaults + * to FALSE. + * @param string $weight + * Menu weight. Defaults to 0. + * + * @return \Drupal\menu_link_content\Entity\MenuLinkContent + * A menu link entity. + */ + function addMenuLink($parent = '', $path = '/', $menu_name = 'tools', $expanded = FALSE, $weight = '0') { + // View add menu link page. + $this->drupalGet("admin/structure/menu/manage/$menu_name/add"); + $this->assertResponse(200); + + $title = '!link_' . $this->randomMachineName(16); + $edit = array( + 'link[0][uri]' => $path, + 'title[0][value]' => $title, + 'description[0][value]' => '', + 'enabled[value]' => 1, + 'expanded[value]' => $expanded, + 'menu_parent' => $menu_name . ':' . $parent, + 'weight[0][value]' => $weight, + ); + + // Add menu link. + $this->drupalPostForm(NULL, $edit, t('Save')); + $this->assertResponse(200); + $this->assertText('The menu link has been saved.'); + + $menu_links = entity_load_multiple_by_properties('menu_link_content', array('title' => $title)); + + $menu_link = reset($menu_links); + $this->assertTrue($menu_link, 'Menu link was found in database.'); + $this->assertMenuLink($menu_link->getPluginId(), array('menu_name' => $menu_name, 'children' => array(), 'parent' => $parent)); + + return $menu_link; + } + /** * Attempts to add menu link with invalid path or no access permission. */ @@ -639,6 +687,45 @@ function checkInvalidParentMenuLinks() { } } + /** + * Verifies a menu link using the UI. + * + * @param \Drupal\menu_link_content\Entity\MenuLinkContent $item + * Menu link. + * @param object $item_node + * Menu link content node. + * @param \Drupal\menu_link_content\Entity\MenuLinkContent $parent + * Parent menu link. + * @param object $parent_node + * Parent menu link content node. + */ + function verifyMenuLink(MenuLinkContent $item, $item_node, MenuLinkContent $parent = NULL, $parent_node = NULL) { + // View home page. + $this->drupalGet(''); + $this->assertResponse(200); + + // Verify parent menu link. + if (isset($parent)) { + // Verify menu link. + $title = $parent->getTitle(); + $this->assertLink($title, 0, 'Parent menu link was displayed'); + + // Verify menu link link. + $this->clickLink($title); + $title = $parent_node->label(); + $this->assertTitle(t("@title | Drupal", array('@title' => $title)), 'Parent menu link link target was correct'); + } + + // Verify menu link. + $title = $item->getTitle(); + $this->assertLink($title, 0, 'Menu link was displayed'); + + // Verify menu link link. + $this->clickLink($title); + $title = $item_node->label(); + $this->assertTitle(t("@title | Drupal", array('@title' => $title)), 'Menu link link target was correct'); + } + /** * Changes the parent of a menu link using the UI. * diff --git a/core/modules/menu_ui/src/Tests/MenuWebTestBase.php b/core/modules/menu_ui/src/Tests/MenuWebTestBase.php index e45068ea486392aa23c19ec5b30de3e74a921645..c08fc1421993ca61508525187d275fd1eb2c1571 100644 --- a/core/modules/menu_ui/src/Tests/MenuWebTestBase.php +++ b/core/modules/menu_ui/src/Tests/MenuWebTestBase.php @@ -2,7 +2,6 @@ namespace Drupal\menu_ui\Tests; -use Drupal\menu_link_content\Entity\MenuLinkContent; use Drupal\simpletest\WebTestBase; /** @@ -75,97 +74,4 @@ function assertMenuLink($menu_plugin_id, array $expected_item) { } } - /** - * Adds a menu link using the UI. - * - * @param string $parent - * Optional parent menu link id. - * @param string $path - * The path to enter on the form. Defaults to the front page. - * @param string $menu_name - * Menu name. Defaults to 'tools'. - * @param bool $expanded - * Whether or not this menu link is expanded. Setting this to TRUE should - * test whether it works when we do the authenticatedUser tests. Defaults - * to FALSE. - * @param string $weight - * Menu weight. Defaults to 0. - * - * @return \Drupal\menu_link_content\Entity\MenuLinkContent - * A menu link entity. - */ - public function addMenuLink($parent = '', $path = '/', $menu_name = 'tools', $expanded = FALSE, $weight = '0') { - // View add menu link page. - $this->drupalGet("admin/structure/menu/manage/$menu_name/add"); - $this->assertResponse(200); - - $title = '!link_' . $this->randomMachineName(16); - $edit = array( - 'link[0][uri]' => $path, - 'title[0][value]' => $title, - 'description[0][value]' => '', - 'enabled[value]' => 1, - 'expanded[value]' => $expanded, - 'menu_parent' => $menu_name . ':' . $parent, - 'weight[0][value]' => $weight, - ); - - // Add menu link. - $this->drupalPostForm(NULL, $edit, t('Save')); - $this->assertResponse(200); - $this->assertText('The menu link has been saved.'); - - $menu_links = entity_load_multiple_by_properties('menu_link_content', array('title' => $title)); - - $menu_link = reset($menu_links); - $this->assertTrue($menu_link, 'Menu link was found in database.'); - $this->assertMenuLink($menu_link->getPluginId(), [ - 'menu_name' => $menu_name, - 'children' => [], - 'parent' => $parent, - ]); - - return $menu_link; - } - - - /** - * Verifies a menu link using the UI. - * - * @param \Drupal\menu_link_content\Entity\MenuLinkContent $item - * Menu link. - * @param object $item_node - * Menu link content node. - * @param \Drupal\menu_link_content\Entity\MenuLinkContent $parent - * Parent menu link. - * @param object $parent_node - * Parent menu link content node. - */ - public function verifyMenuLink(MenuLinkContent $item, $item_node, MenuLinkContent $parent = NULL, $parent_node = NULL) { - // View home page. - $this->drupalGet(''); - $this->assertResponse(200); - - // Verify parent menu link. - if (isset($parent)) { - // Verify menu link. - $title = $parent->getTitle(); - $this->assertLink($title, 0, 'Parent menu link was displayed'); - - // Verify menu link link. - $this->clickLink($title); - $title = $parent_node->label(); - $this->assertTitle(t("@title | Drupal", array('@title' => $title)), 'Parent menu link link target was correct'); - } - - // Verify menu link. - $title = $item->getTitle(); - $this->assertLink($title, 0, 'Menu link was displayed'); - - // Verify menu link link. - $this->clickLink($title); - $title = $item_node->label(); - $this->assertTitle(t("@title | Drupal", array('@title' => $title)), 'Menu link link target was correct'); - } - } diff --git a/core/modules/node/src/Entity/Node.php b/core/modules/node/src/Entity/Node.php index ecbcaafa04246b94a1983090dcaf219858a49d15..bdb80500f7eb3a6ab434dd1248feb5dabb8290a2 100644 --- a/core/modules/node/src/Entity/Node.php +++ b/core/modules/node/src/Entity/Node.php @@ -63,7 +63,6 @@ * permission_granularity = "bundle", * links = { * "canonical" = "/node/{node}", - * "uuid" = "/node/{node}", * "delete-form" = "/node/{node}/delete", * "edit-form" = "/node/{node}/edit", * "version-history" = "/node/{node}/revisions", diff --git a/core/modules/node/src/Entity/NodeRouteProvider.php b/core/modules/node/src/Entity/NodeRouteProvider.php index b46b09d6bf5ea4f00b136e26352a24a5af117d5f..0803f1ef14ac7060a1bc63328061f9393d6d143c 100644 --- a/core/modules/node/src/Entity/NodeRouteProvider.php +++ b/core/modules/node/src/Entity/NodeRouteProvider.php @@ -2,7 +2,6 @@ namespace Drupal\node\Entity; -use Drupal\Component\Uuid\Uuid; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\Routing\EntityRouteProviderInterface; use Symfony\Component\Routing\Route; @@ -18,17 +17,6 @@ class NodeRouteProvider implements EntityRouteProviderInterface { */ public function getRoutes( EntityTypeInterface $entity_type) { $route_collection = new RouteCollection(); - - $route = (new Route("/node/{node}")) - ->addDefaults([ - '_controller' => '\Drupal\node\Controller\NodeViewController::view', - '_title_callback' => '\Drupal\node\Controller\NodeViewController::title', - ]) - // Set requirement for UUID pattern. - ->setRequirement('node', '^' . Uuid::VALID_PATTERN . '$') - ->setRequirement('_entity_access', 'node.view'); - $route_collection->add('entity.node.uuid', $route); - $route = (new Route('/node/{node}')) ->addDefaults([ '_controller' => '\Drupal\node\Controller\NodeViewController::view', diff --git a/core/modules/system/system.install b/core/modules/system/system.install index bede3da179d47c2b4f73a6f599ae94b23a46893a..b3a0ec1d1c9bdd4e44a6c9db14a4df6392b403f2 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -1647,19 +1647,3 @@ function system_update_8014() { /** * @} End of "addtogroup updates-8.0.0-rc". */ - -/** - * @addtogroup updates-8.2.0 - * @{ - */ - -/** - * The simple presence of this update function clears cached entity definitions. - */ -function system_update_8200() { - // Many core entity-types now have a UUID link template and route. -} - -/** - * @} End of "addtogroup updates-8.2.0". - */ diff --git a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTest.php b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTest.php index 38ac4ca667777600dbc9b7d7d347f85b8f27c474..a603f5379438ba147d936f9685cbf330f28209cf 100644 --- a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTest.php +++ b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTest.php @@ -42,7 +42,6 @@ * }, * links = { * "canonical" = "/entity_test/{entity_test}", - * "uuid" = "/entity_test/{entity_test}", * "add-form" = "/entity_test/add", * "edit-form" = "/entity_test/manage/{entity_test}/edit", * "delete-form" = "/entity_test/delete/entity_test/{entity_test}", diff --git a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestBaseFieldDisplay.php b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestBaseFieldDisplay.php index 629a6b5409498f48f7e00251618e2d1044acf3bd..f7fe8e643c6f567123202c39c4cc585b9caa0f40 100644 --- a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestBaseFieldDisplay.php +++ b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestBaseFieldDisplay.php @@ -33,7 +33,6 @@ * }, * links = { * "canonical" = "/entity_test_base_field_display/{entity_test_base_field_display}/edit", - * "uuid" = "/entity_test_base_field_display/{entity_test_base_field_display}/edit", * "add-form" = "/entity_test_base_field_display/add", * "edit-form" = "/entity_test_base_field_display/manage/{entity_test_base_field_display}", * "delete-form" = "/entity_test/delete/entity_test_base_field_display/{entity_test_base_field_display}/edit", diff --git a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMul.php b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMul.php index 3a11384cb7828450247dfc1118f669474444c87a..cbe7ba4c9ba5e53f565d9213320e83f71a944cfd 100644 --- a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMul.php +++ b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMul.php @@ -36,7 +36,6 @@ * "add-page" = "/entity_test_mul/add", * "add-form" = "/entity_test_mul/add/{type}", * "canonical" = "/entity_test_mul/manage/{entity_test_mul}", - * "uuid" = "/entity_test_mul/manage/{entity_test_mul}", * "edit-form" = "/entity_test_mul/manage/{entity_test_mul}/edit", * "delete-form" = "/entity_test/delete/entity_test_mul/{entity_test_mul}", * }, diff --git a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulChanged.php b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulChanged.php index f7426c2e5b4138faf5848c17b5f2962051652005..5fbc408df833fd963a48743b660c03f21a10e2c4 100644 --- a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulChanged.php +++ b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulChanged.php @@ -39,7 +39,6 @@ * links = { * "add-form" = "/entity_test_mul_changed/add", * "canonical" = "/entity_test_mul_changed/manage/{entity_test_mul_changed}", - * "uuid" = "/entity_test_mul_changed/manage/{entity_test_mul_changed}", * "edit-form" = "/entity_test_mul_changed/manage/{entity_test_mul_changed}/edit", * "delete-form" = "/entity_test/delete/entity_test_mul_changed/{entity_test_mul_changed}", * }, diff --git a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulLangcodeKey.php b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulLangcodeKey.php index adc4357db8a86a0990d91585e8c590f7a800217b..94948a344e7f092df75320d63fc7b4cdf7519e39 100644 --- a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulLangcodeKey.php +++ b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulLangcodeKey.php @@ -36,7 +36,6 @@ * links = { * "add-form" = "/entity_test_mul_langcode_key/add", * "canonical" = "/entity_test_mul_langcode_key/manage/{entity_test_mul_langcode_key}", - * "uuid" = "/entity_test_mul_langcode_key/manage/{entity_test_mul_langcode_key}", * "edit-form" = "/entity_test_mul_langcode_key/manage/{entity_test_mul_langcode_key}/edit", * "delete-form" = "/entity_test/delete/entity_test_mul_langcode_key/{entity_test_mul_langcode_key}", * }, diff --git a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulRev.php b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulRev.php index 74e987f478c91b7864a582fd103be3982b4386e7..0ee28bf032dc7bdc585b67b9e4faf7b622e45aa5 100644 --- a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulRev.php +++ b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulRev.php @@ -38,7 +38,6 @@ * links = { * "add-form" = "/entity_test_mulrev/add", * "canonical" = "/entity_test_mulrev/manage/{entity_test_mulrev}", - * "uuid" = "/entity_test_mulrev/manage/{entity_test_mulrev}", * "delete-form" = "/entity_test/delete/entity_test_mulrev/{entity_test_mulrev}", * "edit-form" = "/entity_test_mulrev/manage/{entity_test_mulrev}/edit", * "revision" = "/entity_test_mulrev/{entity_test_mulrev}/revision/{entity_test_mulrev_revision}/view", diff --git a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulRevChanged.php b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulRevChanged.php index 500b1e3021074356772fa40c717e1fe60b7bfd38..391307576ea7b7549cdc6d996ee552d684637b82 100644 --- a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulRevChanged.php +++ b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulRevChanged.php @@ -40,7 +40,6 @@ * links = { * "add-form" = "/entity_test_mulrev_changed/add", * "canonical" = "/entity_test_mulrev_changed/manage/{entity_test_mulrev_changed}", - * "uuid" = "/entity_test_mulrev_changed/manage/{entity_test_mulrev_changed}", * "delete-form" = "/entity_test/delete/entity_test_mulrev_changed/{entity_test_mulrev_changed}", * "edit-form" = "/entity_test_mulrev_changed/manage/{entity_test_mulrev_changed}/edit", * "revision" = "/entity_test_mulrev_changed/{entity_test_mulrev_changed}/revision/{entity_test_mulrev_changed_revision}/view", diff --git a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestRev.php b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestRev.php index 5c8a86f6b497106496fed2b78abc6f1dcfbc3b88..b299d9011d9da998e070e93f88fca86dd5de781e 100644 --- a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestRev.php +++ b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestRev.php @@ -39,7 +39,6 @@ * links = { * "add-form" = "/entity_test_rev/add", * "canonical" = "/entity_test_rev/manage/{entity_test_rev}", - * "uuid" = "/entity_test_rev/manage/{entity_test_rev}", * "delete-form" = "/entity_test/delete/entity_test_rev/{entity_test_rev}", * "edit-form" = "/entity_test_rev/manage/{entity_test_rev}/edit", * "revision" = "/entity_test_rev/{entity_test_rev}/revision/{entity_test_rev_revision}/view", diff --git a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestStringId.php b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestStringId.php index 752013ccfd8cba28a6e58a9bb3a13307a785f1ab..a63abada07daccddea9c3c935d4b086ef80ee87f 100644 --- a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestStringId.php +++ b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestStringId.php @@ -29,7 +29,6 @@ * }, * links = { * "canonical" = "/entity_test_string_id/manage/{entity_test_string_id}", - * "uuid" = "/entity_test_string_id/manage/{entity_test_string_id}", * "add-form" = "/entity_test_string_id/add", * "edit-form" = "/entity_test_string_id/manage/{entity_test_string_id}", * }, diff --git a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestWithBundle.php b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestWithBundle.php index 7ef8e3a5f40d908bc45215abb391d5df6a3502ad..c668bd3ee80bc655d1243c423c15c6ba9ac5b299 100644 --- a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestWithBundle.php +++ b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestWithBundle.php @@ -37,7 +37,6 @@ * bundle_entity_type = "entity_test_bundle", * links = { * "canonical" = "/entity_test_with_bundle/{entity_test_with_bundle}", - * "uuid" = "/entity_test_with_bundle/{entity_test_with_bundle}", * "add-page" = "/entity_test_with_bundle/add", * "add-form" = "/entity_test_with_bundle/add/{entity_test_bundle}", * "edit-form" = "/entity_test_with_bundle/{entity_test_with_bundle}/edit", diff --git a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestWithRevisionLog.php b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestWithRevisionLog.php index 465e663cf2ffe15fd31a3fcf2a46d2adeb570511..4f4f4f1f259e2f4cb376526acecfe6b223a6288d 100644 --- a/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestWithRevisionLog.php +++ b/core/modules/system/tests/modules/entity_test/src/Entity/EntityTestWithRevisionLog.php @@ -37,7 +37,6 @@ * }, * links = { * "canonical" = "/entity_test_revlog/manage/{entity_test_revlog}", - * "uuid" = "/entity_test_revlog/manage/{entity_test_revlog}", * "delete-form" = "/entity_test/delete/entity_test_revlog/{entity_test_revlog}", * "edit-form" = "/entity_test_revlog/manage/{entity_test_revlog}/edit", * "revision" = "/entity_test_revlog/{entity_test_revlog}/revision/{entity_test_revlog_revision}/view", diff --git a/core/modules/taxonomy/src/Entity/Term.php b/core/modules/taxonomy/src/Entity/Term.php index 6e70bbf74d9bb7eb9d612241df2e792ce4f8b76b..2e41e2d0f01654f1649da2e8392efbd8df46e9c1 100644 --- a/core/modules/taxonomy/src/Entity/Term.php +++ b/core/modules/taxonomy/src/Entity/Term.php @@ -44,7 +44,6 @@ * common_reference_target = TRUE, * links = { * "canonical" = "/taxonomy/term/{taxonomy_term}", - * "uuid" = "/taxonomy/term/{taxonomy_term}", * "delete-form" = "/taxonomy/term/{taxonomy_term}/delete", * "edit-form" = "/taxonomy/term/{taxonomy_term}/edit", * }, diff --git a/core/modules/taxonomy/taxonomy.routing.yml b/core/modules/taxonomy/taxonomy.routing.yml index 4957fa936c1ec2025e807915bc2bfc91e91d01b4..8a3bd1a58d455d6b9ee0cc2bc0ca8533b5305a46 100644 --- a/core/modules/taxonomy/taxonomy.routing.yml +++ b/core/modules/taxonomy/taxonomy.routing.yml @@ -76,16 +76,6 @@ entity.taxonomy_vocabulary.overview_form: requirements: _entity_access: 'taxonomy_vocabulary.view' -entity.taxonomy_term.uuid: - path: '/taxonomy/term/{taxonomy_term}' - defaults: - _entity_view: 'taxonomy_term.full' - _title: 'Taxonomy term' - _title_callback: '\Drupal\taxonomy\Controller\TaxonomyController::termTitle' - requirements: - _entity_access: 'taxonomy_term.view' - taxonomy_term: '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' - entity.taxonomy_term.canonical: path: '/taxonomy/term/{taxonomy_term}' defaults: diff --git a/core/modules/user/src/Entity/User.php b/core/modules/user/src/Entity/User.php index 1a4b5d7111c6f695f0b5686d484fc171bd88434a..030b9a933a912ad6d486372c5e0ed0c61cfbeff6 100644 --- a/core/modules/user/src/Entity/User.php +++ b/core/modules/user/src/Entity/User.php @@ -48,7 +48,6 @@ * }, * links = { * "canonical" = "/user/{user}", - * "uuid" = "/user/{user}", * "edit-form" = "/user/{user}/edit", * "cancel-form" = "/user/{user}/cancel", * "collection" = "/admin/people", diff --git a/core/modules/user/src/Entity/UserRouteProvider.php b/core/modules/user/src/Entity/UserRouteProvider.php index 14543bb29e3064d9c9d3405d94b8b4c04f26d71e..d1e967184e8734a1ff3012f4753e15ac50993270 100644 --- a/core/modules/user/src/Entity/UserRouteProvider.php +++ b/core/modules/user/src/Entity/UserRouteProvider.php @@ -2,7 +2,6 @@ namespace Drupal\user\Entity; -use Drupal\Component\Uuid\Uuid; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\Routing\EntityRouteProviderInterface; use Symfony\Component\Routing\Route; @@ -18,17 +17,6 @@ class UserRouteProvider implements EntityRouteProviderInterface { */ public function getRoutes(EntityTypeInterface $entity_type) { $route_collection = new RouteCollection(); - - $route = (new Route("/user/{user}")) - ->addDefaults([ - '_entity_view' => 'user.full', - '_title_callback' => 'Drupal\user\Controller\UserController::userTitle', - ]) - // Set requirement for UUID pattern. - ->setRequirement('user', '^' . Uuid::VALID_PATTERN . '$') - ->setRequirement('_entity_access', 'user.view'); - $route_collection->add('entity.user.uuid', $route); - $route = (new Route('/user/{user}')) ->setDefaults([ '_entity_view' => 'user.full', diff --git a/core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php b/core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php index 9644ed1149cd5e7241e7b26cbb58c890e2ca3375..71966527602c2fcd6f60e2e50f7f0da5af40372f 100644 --- a/core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/Routing/DefaultHtmlRouteProviderTest.php @@ -7,7 +7,6 @@ namespace Drupal\Tests\Core\Entity\Routing; -use Drupal\Component\Uuid\Uuid; use Drupal\Core\Config\Entity\ConfigEntityTypeInterface; use Drupal\Core\Entity\EntityFieldManagerInterface; use Drupal\Core\Entity\EntityTypeInterface; @@ -253,59 +252,6 @@ public function providerTestGetCanonicalRoute() { return $data; } - /** - * @covers ::getUuidRoute - * @dataProvider providerTestGetUuidRoute - */ - public function testGetUuidRoute(EntityTypeInterface $entity_type, Route $expected = NULL) { - $route = $this->routeProvider->getUuidRoute($entity_type); - $this->assertEquals($expected, $route); - } - - public function providerTestGetUuidRoute() { - $data = []; - - $entity_type1 = $this->getEntityType(); - $entity_type1->getKey('uuid')->willReturn(FALSE); - $data['no_canonical_link_template'] = [$entity_type1->reveal()]; - - $entity_type2 = $this->getEntityType();; - $entity_type2->getKey('uuid')->willReturn(TRUE); - $entity_type2->hasViewBuilderClass()->willReturn(FALSE); - $data['no_view_builder'] = [$entity_type2->reveal()]; - - $entity_type3 = $this->getEntityType($entity_type2);; - $entity_type3->hasViewBuilderClass()->willReturn(TRUE); - $entity_type3->hasLinkTemplate('uuid')->willReturn(FALSE); - $data['no_uuid_link_template'] = [$entity_type2->reveal()]; - - $entity_type4 = $this->getEntityType($entity_type2); - $entity_type4->hasViewBuilderClass()->willReturn(TRUE); - $entity_type4->id()->willReturn('the_entity_type_id'); - $entity_type4->getKey('uuid')->willReturn(TRUE); - $entity_type4->hasLinkTemplate('uuid')->willReturn(TRUE); - $entity_type4->getLinkTemplate('uuid')->willReturn('/the_entity_type_id/{the_entity_type_id}'); - $entity_type4->isSubclassOf(FieldableEntityInterface::class)->willReturn(FALSE); - $route = (new Route('/the_entity_type_id/{the_entity_type_id}')) - ->setDefaults([ - '_entity_view' => 'the_entity_type_id.full', - '_title_callback' => '\Drupal\Core\Entity\Controller\EntityController::title', - ]) - ->setRequirements([ - '_entity_access' => 'the_entity_type_id.view', - 'the_entity_type_id' => '^' . Uuid::VALID_PATTERN . '$', - ]) - ->setOptions([ - 'parameters' => [ - 'the_entity_type_id' => [ - 'type' => 'entity:the_entity_type_id', - ], - ], - ]); - $data['has_uuid_route'] = [$entity_type4->reveal(), $route]; - return $data; - } - /** * @covers ::getEntityTypeIdKeyType */ @@ -367,8 +313,5 @@ public function getAddFormRoute(EntityTypeInterface $entity_type) { public function getCanonicalRoute(EntityTypeInterface $entity_type) { return parent::getCanonicalRoute($entity_type); } - public function getUuidRoute(EntityTypeInterface $entity_type) { - return parent::getUuidRoute($entity_type); - } } diff --git a/core/tests/Drupal/Tests/Core/Menu/DefaultMenuLinkTreeManipulatorsTest.php b/core/tests/Drupal/Tests/Core/Menu/DefaultMenuLinkTreeManipulatorsTest.php index 24aa65faa30e1cf077c1ccdb1c68b63a55fda338..2000fe606f085768173eaabef79a93df3883fff8 100644 --- a/core/tests/Drupal/Tests/Core/Menu/DefaultMenuLinkTreeManipulatorsTest.php +++ b/core/tests/Drupal/Tests/Core/Menu/DefaultMenuLinkTreeManipulatorsTest.php @@ -5,7 +5,6 @@ use Drupal\Core\Access\AccessResult; use Drupal\Core\Cache\Context\CacheContextsManager; use Drupal\Core\DependencyInjection\Container; -use Drupal\Core\Entity\Query\ConditionInterface; use Drupal\Core\Menu\DefaultMenuLinkTreeManipulators; use Drupal\Core\Menu\MenuLinkTreeElement; use Drupal\Tests\UnitTestCase; @@ -275,7 +274,7 @@ public function testCheckNodeAccess() { 1 => MenuLinkMock::create(array('id' => 'node.1', 'route_name' => 'entity.node.canonical', 'title' => 'foo', 'parent' => '', 'route_parameters' => array('node' => 1))), 2 => MenuLinkMock::create(array('id' => 'node.2', 'route_name' => 'entity.node.canonical', 'title' => 'bar', 'parent' => '', 'route_parameters' => array('node' => 2))), 3 => MenuLinkMock::create(array('id' => 'node.3', 'route_name' => 'entity.node.canonical', 'title' => 'baz', 'parent' => 'node.2', 'route_parameters' => array('node' => 3))), - 4 => MenuLinkMock::create(array('id' => 'node.4', 'route_name' => 'entity.node.uuid', 'title' => 'qux', 'parent' => 'node.3', 'route_parameters' => array('node' => 4))), + 4 => MenuLinkMock::create(array('id' => 'node.4', 'route_name' => 'entity.node.canonical', 'title' => 'qux', 'parent' => 'node.3', 'route_parameters' => array('node' => 4))), 5 => MenuLinkMock::create(array('id' => 'test.1', 'route_name' => 'test_route', 'title' => 'qux', 'parent' => '')), 6 => MenuLinkMock::create(array('id' => 'test.2', 'route_name' => 'test_route', 'title' => 'qux', 'parent' => 'test.1')), ); @@ -291,22 +290,10 @@ public function testCheckNodeAccess() { )); $query = $this->getMock('Drupal\Core\Entity\Query\QueryInterface'); - $condition = $this->getMock(ConditionInterface::class); $query->expects($this->at(0)) - ->method('orConditionGroup') - ->willReturn($condition); - $condition->expects($this->at(0)) ->method('condition') - ->with('nid', array(1, 2, 3, 4)) - ->willReturn($condition); - $condition->expects($this->at(1)) - ->method('condition') - ->with('uuid', array(1, 2, 3, 4)) - ->willReturn($condition); + ->with('nid', array(1, 2, 3, 4)); $query->expects($this->at(1)) - ->method('condition') - ->with($condition); - $query->expects($this->at(2)) ->method('condition') ->with('status', NODE_PUBLISHED); $query->expects($this->once()) diff --git a/core/tests/Drupal/Tests/Core/ParamConverter/EntityConverterTest.php b/core/tests/Drupal/Tests/Core/ParamConverter/EntityConverterTest.php index 7b6fcc8c39b69f6783dfb32b0d8f5a4bc524bd85..ebafab0c96a10b88cbd470ce64a74cf53e531a2a 100644 --- a/core/tests/Drupal/Tests/Core/ParamConverter/EntityConverterTest.php +++ b/core/tests/Drupal/Tests/Core/ParamConverter/EntityConverterTest.php @@ -89,12 +89,6 @@ public function testConvert($value, array $definition, array $defaults, $expecte ['valid_id', (object) ['id' => 'valid_id']], ['invalid_id', NULL], ]); - $entity_storage->expects($this->any()) - ->method('loadByProperties') - ->willReturnMap([ - [['uuid' => 'invalid_id'], NULL], - [['uuid' => $value], [(object) ['uuid' => $value, 'id' => 'valid_id']]], - ]); $this->assertEquals($expected_result, $this->entityConverter->convert($value, $definition, 'foo', $defaults)); } @@ -110,8 +104,6 @@ public function providerTestConvert() { $data[] = ['invalid_id', ['type' => 'entity:entity_test'], ['foo' => 'invalid_id'], NULL]; // Entity type placeholder. $data[] = ['valid_id', ['type' => 'entity:{entity_type}'], ['foo' => 'valid_id', 'entity_type' => 'entity_test'], (object) ['id' => 'valid_id']]; - // UUID. - $data[] = ['1c5217f4-553c-40d8-8389-a3cc3529d79c', ['type' => 'entity:entity_test'], ['foo' => '1c5217f4-553c-40d8-8389-a3cc3529d79c'], (object) ['uuid' => '1c5217f4-553c-40d8-8389-a3cc3529d79c', 'id' => 'valid_id']]; return $data; } diff --git a/core/tests/Drupal/Tests/Core/UrlTest.php b/core/tests/Drupal/Tests/Core/UrlTest.php index 0376b8d6c4f8c2b1b1fd48ee3fa0a60b291c7a33..2808a209ab03e271cce54074f2455c1d32415de2 100644 --- a/core/tests/Drupal/Tests/Core/UrlTest.php +++ b/core/tests/Drupal/Tests/Core/UrlTest.php @@ -582,14 +582,6 @@ public function providerTestEntityUris() { ['page' => '1', 'foo' => 'yes', 'focus' => 'no'], 'top', ], - [ - 'entity:test_entity/d44a0040-2844-4cca-b0b5-20c6c96c4d8c', - ['fragment' => ''], - 'entity.test_entity.uuid', - ['test_entity' => 'd44a0040-2844-4cca-b0b5-20c6c96c4d8c'], - NULL, - NULL, - ], ]; }