diff --git a/metatag.admin.inc b/metatag.admin.inc index 380bbbe..eff1b23 100644 --- a/metatag.admin.inc +++ b/metatag.admin.inc @@ -269,7 +269,7 @@ function metatag_config_edit_form($form, &$form_state, $config) { $contexts = explode(':', $config->instance); $options['context'] = $contexts[0]; if ($contexts[0] != 'global') { - $options['token types'] = array(token_get_entity_mapping('entity', $contexts[0])); + $options['token types'] = array(0 => 'view') + array(token_get_entity_mapping('entity', $contexts[0])); } // Ensure that this configuration is properly compared to its parent 'default' diff --git a/metatag.module b/metatag.module index 1b0e243..97f9e33 100644 --- a/metatag.module +++ b/metatag.module @@ -486,7 +486,7 @@ function metatag_entity_view($entity, $entity_type, $view_mode, $langcode) { } // Reload the entity object from cache as it may have been altered. - $token_type = token_get_entity_mapping('entity', $entity_type); + $token_type = array(0 => 'view') + token_get_entity_mapping('entity', $entity_type); $entities = entity_load($entity_type, array($entity_id)); $options['token data'][$token_type] = $entities[$entity_id]; $options['entity'] = $entities[$entity_id]; @@ -919,7 +919,7 @@ function metatag_field_attach_form($entity_type, $entity, &$form, &$form_state, $instance = "{$entity_type}:{$bundle}"; $metatags = isset($entity->metatags) ? $entity->metatags : array(); - $options['token types'] = array(token_get_entity_mapping('entity', $entity_type)); + $options['token types'] = array(0 => 'view') + array(token_get_entity_mapping('entity', $entity_type)); $options['context'] = $entity_type; // @todo Remove metatag_form_alter() when http://drupal.org/node/1284642 is fixed in core.