Skip to content
Snippets Groups Projects
Commit ae6fc17a authored by Dave Reid's avatar Dave Reid
Browse files

Prevent a token merge conflicts when the entity type already has a token named...

Prevent a token merge conflicts when the entity type already has a token named 'id', 'label', or 'url', e.g. [file:url].
parent 14d6954d
No related branches found
No related tags found
No related merge requests found
......@@ -47,6 +47,13 @@ function token_formatters_tokens($type, $tokens, array $data = array(), array $o
$entity_type = $data['entity_type'];
foreach ($tokens as $name => $original) {
// Prevent tokensn like [entity:url] from getting a replacement value
// when the entity type already has a token with the same name. For
// example, [file:url].
if (!empty($data['token_type']) && token_get_info($data['token_type'], $name)) {
break;
}
switch ($name) {
case 'id':
list($id) = entity_extract_ids($entity_type, $entity);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment