diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-06-28 18:21:46 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-06-28 18:21:46 +0000 |
commit | 02b746382e55aa728760650eec2dd6f9a8e3239e (patch) | |
tree | 52977b9d96d12bb535be4811a04764747787d3ad | |
parent | 99484ebff22c2e43cfdc8213c42275c141fdcbaf (diff) | |
download | brdo-02b746382e55aa728760650eec2dd6f9a8e3239e.tar.gz brdo-02b746382e55aa728760650eec2dd6f9a8e3239e.tar.bz2 |
- Patch #839520 by agentrickard: entity_uri() should pass the entity data to url().
-rw-r--r-- | includes/common.inc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/includes/common.inc b/includes/common.inc index d37f0588b..83da25e2b 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -1975,6 +1975,10 @@ function format_username($account) { * Drupal on a web server that cannot be configured to automatically find * index.php, then hook_url_outbound_alter() can be implemented to force * this value to 'index.php'. + * - 'entity_type': The entity type of the object that called url(). Only set if + * url() is invoked by entity_uri(). + * - 'entity': The entity object (such as a node) for which the URL is being + * generated. Only set if url() is invoked by entity_uri(). * * @return * A string containing a URL to the given path. @@ -6629,6 +6633,10 @@ function entity_uri($entity_type, $entity) { if (!isset($entity->uri['options'])) { $entity->uri['options'] = array(); } + // Pass the entity data to url() so that alter functions do not need to + // lookup this entity again. + $entity->uri['options']['entity_type'] = $entity_type; + $entity->uri['options']['entity'] = $entity; } else { $entity->uri = FALSE; |