Skip to content

Commit

Permalink
Issue #1962358 by penyaskito: Entity::urlInfo() returns a Drupal\Core…
Browse files Browse the repository at this point in the history
…\Url object. See http://drupal.org/node/2215961
  • Loading branch information
penyaskito committed Mar 30, 2014
1 parent 37420c2 commit 4b073dc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions token.tokens.inc
Expand Up @@ -414,7 +414,7 @@ function token_tokens($type, $tokens, array $data = array(), array $options = ar

// Chained token relationships.
if (($url_tokens = \Drupal::token()->findWithPrefix($tokens, 'url'))) {
$replacements += \Drupal::token()->generate('url', $url_tokens, $comment->urlInfo(), $options);
$replacements += \Drupal::token()->generate('url', $url_tokens, (array) $comment->urlInfo(), $options);
}
}

Expand Down Expand Up @@ -449,7 +449,7 @@ function token_tokens($type, $tokens, array $data = array(), array $options = ar
$replacements += \Drupal::token()->generate('content-type', $node_type_tokens, array('node_type' => $node_type), $options);
}
if (($url_tokens = \Drupal::token()->findWithPrefix($tokens, 'url'))) {
$replacements += \Drupal::token()->generate('url', $url_tokens, $node->urlInfo(), $options);
$replacements += \Drupal::token()->generate('url', $url_tokens, (array) $node->urlInfo(), $options);
}
}

Expand Down Expand Up @@ -512,7 +512,7 @@ function token_tokens($type, $tokens, array $data = array(), array $options = ar

// Chained token relationships.
if (($url_tokens = \Drupal::token()->findWithPrefix($tokens, 'url'))) {
$replacements += \Drupal::token()->generate('url', $url_tokens, $term->urlInfo(), $options);
$replacements += \Drupal::token()->generate('url', $url_tokens, (array) $term->urlInfo(), $options);
}
// [term:parents:*] chained tokens.
if ($parents_tokens = \Drupal::token()->findWithPrefix($tokens, 'parents')) {
Expand Down Expand Up @@ -818,7 +818,7 @@ function token_tokens($type, $tokens, array $data = array(), array $options = ar

// [entity:url:*] chained tokens.
if (($url_tokens = \Drupal::token()->findWithPrefix($tokens, 'url')) && _token_module($type, 'url') == 'token') {
$replacements += \Drupal::token()->generate('url', $url_tokens, $entity->urlInfo(), $options);
$replacements += \Drupal::token()->generate('url', $url_tokens, (array) $entity->urlInfo(), $options);
}

// [entity:original:*] chained tokens.
Expand Down

0 comments on commit 4b073dc

Please sign in to comment.