diff --git a/core/includes/common.inc b/core/includes/common.inc index 15c54d3..98292cf 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -2033,10 +2033,10 @@ function _format_date_callback(array $matches = NULL, $new_langcode = NULL) { * - 'script': Added to the URL between the base path and the path prefix. * Defaults to empty string when clean URLs are in effect, and to * 'index.php/' when they are not. - * - 'entity_type': The entity type of the object that called url(). Only - * set if url() is invoked by entity_uri(). + * - 'entity_type': The entity type of the object that called url(). Only set + * by Entity::uri() but is not used anywhere. * - 'entity': The entity object (such as a node) for which the URL is being - * generated. Only set if url() is invoked by entity_uri(). + * generated. Only set by Entity:uri() but is not used anywhere. * * @return * A string containing a URL to the given path. diff --git a/core/modules/entity/entity.module b/core/modules/entity/entity.module index daaa9f6..ded4079 100644 --- a/core/modules/entity/entity.module +++ b/core/modules/entity/entity.module @@ -369,49 +369,6 @@ function entity_prepare_view($entity_type, $entities) { } /** - * Returns the uri elements of an entity. - * - * @param $entity_type - * The entity type; e.g. 'node' or 'user'. - * @param $entity - * The entity for which to generate a path. - * - * @return - * An array containing the 'path' and 'options' keys used to build the uri of - * the entity, and matching the signature of url(). NULL if the entity has no - * uri of its own. - * - * @todo - * Remove once all entity types are implementing the EntityInterface. - */ -function entity_uri($entity_type, $entity) { - $info = entity_get_info($entity_type); - list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity); - - // A bundle-specific callback takes precedence over the generic one for the - // entity type. - if (isset($info['bundles'][$bundle]['uri callback'])) { - $uri_callback = $info['bundles'][$bundle]['uri callback']; - } - elseif (isset($info['uri callback'])) { - $uri_callback = $info['uri callback']; - } - else { - return NULL; - } - - // Invoke the callback to get the URI. If there is no callback, return NULL. - if (isset($uri_callback)) { - $uri = $uri_callback($entity); - // Pass the entity data to url() so that alter functions do not need to - // lookup this entity again. - $uri['options']['entity_type'] = $entity_type; - $uri['options']['entity'] = $entity; - return $uri; - } -} - -/** * Returns the label of an entity. * * See the 'label callback' component of the hook_entity_info() return value diff --git a/core/modules/entity/lib/Drupal/entity/Entity.php b/core/modules/entity/lib/Drupal/entity/Entity.php index f0f5a76..62d95c6 100644 --- a/core/modules/entity/lib/Drupal/entity/Entity.php +++ b/core/modules/entity/lib/Drupal/entity/Entity.php @@ -103,8 +103,6 @@ class Entity implements EntityInterface { /** * Implements EntityInterface::uri(). - * - * @see entity_uri() */ public function uri() { $bundle = $this->bundle();