I put this here because I don't know which contributed module is causing this Token-related issue yet.
I couldn't find an exact duplicate either.

/admin/reports/status
shows warning message:

The following token types are not defined but have tokens:
$info['types']['taxonomy_term']

Drupal 7.12

CommentFileSizeAuthor
#3 issue_1529788.txt6.12 KBRefineo

Comments

dave reid’s picture

Category: bug » support
Status: Active » Fixed

Yeah, it will probably take a bit of research to figure out which module it's coming from. If you figure it out, please file an issue against that module.

Refineo’s picture

Status: Fixed » Active

@Dave Reid, before I raise 16 separate issues for the modules listed below, could you please confirm that using or setting the $entity_info['taxonomy_term'][' in the contrib module code might have caused "Token types are not defined but have tokens: taxonomy_term" ? I would appreciate your feedback.

Summary

Tha Status report at /admin/reports/status shows warning message:

The following token types are not defined but have tokens:
$info['types']['taxonomy_term']

I found that it is potentially related to at least the following contrib modules:

  • context
  • custom_breadcrumbs
  • ds
  • entity
  • entitycache
  • i18n
  • metatag
  • notifications
  • page_title
  • pathauto
  • similarterms
  • subscriptions
  • tagging
  • uuid
  • views
  • xmlsitemap

i.e. 16 out of 209 contributed modules I tested against this grep command.

Use:

grep -R -F -n "$entity_info['taxonomy_term']" .

Output:

please see the attachment to see where $entity_info['taxonomy_term'] is used.

Analysis

After analysing the code I doubt this is caused by page_tile, ds, similarterms, subscriptions, tagging
where taxonomy_term existance is first checked using isset function, for example in page_title:

./page_title/modules/node.page_title.inc:50:        if (isset($instance['taxonomy_term'])) {
./page_title/modules/node.page_title.inc:51:          $types['term'] = $instance['taxonomy_term'];

but this might be an issue in

- entitycache:
./entitycache/entitycache.module:258: unset($return['taxonomy_term']);

- xmlsitemap:

./xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.module:7:  $entity_info['taxonomy_term']['bundle label'] = t('Vocabulary');
./xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.module:8:  $entity_info['taxonomy_term']['xmlsitemap'] = array(
./xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.module:19:    $link_info['taxonomy_term']['bundles'][$machine_name]['admin']['path'] .= '/edit';
./xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.module:20:    $link_info['taxonomy_term']['bundles'][$machine_name]['admin']['real path'] .= '/edit';
./xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.module:134:    $extras['taxonomy_term'][$machine_name]['form']['xmlsitemap'] = array(

- i18n:

./i18n/i18n_translation/i18n_translation.api.php:20:  $info['taxonomy_term'] = array(
./i18n/i18n.api.php:55:  $info['taxonomy_term'] = array(
./i18n/i18n_taxonomy/i18n_taxonomy.i18n.inc:11:  $info['taxonomy_term'] = array(
./i18n/i18n_taxonomy/i18n_taxonomy.i18n.inc:72:  $info['taxonomy_term'] = array(
./i18n/i18n_taxonomy/i18n_taxonomy.module:204:  // yet and $item['taxonomy_term'] is not set. Theme such terms as
./i18n/i18n_taxonomy/i18n_taxonomy.module:216:          $term = $item['taxonomy_term'];
./i18n/i18n_taxonomy/i18n_taxonomy.module:230:        $name = ($item['tid'] != 'autocreate' ? i18n_taxonomy_term_name($item['taxonomy_term'], $language->language): $item['name']);
./i18n/i18n_taxonomy/i18n_taxonomy.module:250:      $return['taxonomy_term'][$bundle] = i18n_language_field_extra();
./i18n/i18n_taxonomy/i18n_taxonomy.module:333:    $term = isset($item['taxonomy_term']) ? $item['taxonomy_term'] : taxonomy_term_load($item['tid']);
./i18n/i18n_taxonomy/i18n_taxonomy.module:1168:  if (isset($entity_info['taxonomy_term'])) {
./i18n/i18n_taxonomy/i18n_taxonomy.module:1171:    $entity_info['taxonomy_term']['label callback'] = 'i18n_taxonomy_taxonomy_term_label';

- metatag:

./metatag/metatag.module:706:  $defaults['taxonomy_term'] = array(
./metatag/metatag.module:710:    $defaults['taxonomy_term']['bundles'][$vocabulary->machine_name]['path'] = 'forum/%taxonomy_term';

- views:

./views/modules/taxonomy.views_default.inc:88:  $translatables['taxonomy_term'] = array(
./views/modules/taxonomy.views_default.inc:105:  $views['taxonomy_term'] = $view;
./views/views.api.php:755:  if (isset($views['taxonomy_term'])) {
./views/views.api.php:756:    $views['taxonomy_term']->display['default']->display_options['title'] = 'Categories';

- custom_breadcrumbs:
./custom_breadcrumbs/custom_breadcrumbs_taxonomy/custom_breadcrumbs_taxonomy.module:56: $breadcrumb_type_info['taxonomy_term'] = array(

- notifications:

./notifications/notifications_tags/notifications_tags.module:67:      $types['taxonomy_term'] = array(
./notifications/notifications_tags/notifications_tags.module:111:      $types['taxonomy_term'] = array(
./notifications/notifications_tags/notifications_tags.module:206:          $term = isset($item['taxonomy_term']) ? $item['taxonomy_term'] : taxonomy_term_load($item['tid']);
./notifications/notifications_scheduler/notifications_scheduler.module:211:  if (!empty($context['taxonomy_term']) && $term = taxonomy_term_load($context['taxonomy_term'])) {
./notifications/notifications_scheduler/notifications_scheduler.module:219:    $form['taxonomy_term'] = array(
./notifications/notifications_scheduler/notifications_scheduler.module:240:  if (isset($form_state['values']['taxonomy_term'])) {
./notifications/notifications_scheduler/notifications_scheduler.module:241:    $params['taxonomy_term'] = $form_state['values']['taxonomy_term'];

- entity:

./entity/modules/taxonomy.info.inc:16:  $properties = &$info['taxonomy_term']['properties'];
./entity/entity.module:1273:    $entity_info['taxonomy_term']['plural label'] = t('Taxonomy terms');
./entity/entity.module:1274:    $entity_info['taxonomy_term']['description'] = t('Taxonomy terms are used for classifying content.');
./entity/entity.module:1275:    $entity_info['taxonomy_term']['access callback'] = 'entity_metadata_taxonomy_access';
./entity/entity.module:1276:    $entity_info['taxonomy_term']['creation callback'] = 'entity_metadata_create_object';
./entity/entity.module:1277:    $entity_info['taxonomy_term']['save callback'] = 'taxonomy_term_save';
./entity/entity.module:1278:    $entity_info['taxonomy_term']['deletion callback'] = 'taxonomy_term_delete';
./entity/entity.module:1279:    $entity_info['taxonomy_term']['view callback'] = 'entity_metadata_view_single';
./entity/entity.module:1280:    $entity_info['taxonomy_term']['form callback'] = 'entity_metadata_form_taxonomy_term';
./entity/entity.module:1290:    $entity_info['taxonomy_term']['token type'] = 'term';

- context:
./context/context.plugins.inc:79: $registry['conditions']['taxonomy_term'] = array(

- pathauto:

./pathauto/pathauto.module:384:      if (!isset($info['taxonomy_term'][$vocabulary->machine_name]['form']['path'])) {
./pathauto/pathauto.module:385:        $info['taxonomy_term'][$vocabulary->machine_name]['form']['path'] = array(

- uuid:
./uuid/uuid.entity.inc:55: $info['taxonomy_term'] = array(

Next steps

I would comment out the identified code above module by module and check if the report warning message disappears.

Refineo’s picture

StatusFileSize
new6.12 KB

The grep output attached.

kazar’s picture

Refineo, did you ever narrow this down? I just installed Drupal Commons 3 and came up with this same Token error.

Of those modules you did not yet cross out in the above list, these are NOT included in the DC3 installation profile:

context
custom_breadcrumbs
entitycache
i18n
metatag
notifications
pathauto
uuid
xmlsitemap

Only these two modules in your list also exist in the DC3 installation:
entity
views

Does that help? Did you by chance identify one of these as being the problem?

And I'm curious to know the impact of this error, does Token work?

thanks much for all the above research

Topcheese’s picture

Hi, I also still see this issue across all my platforms. What might you need in order to help track this down? I see there are still similar issues out there, and this one seems to involve a core module. the following token types are not defined but have tokens $info['types']['registration'], The following token types are not defined but have tokens.

keithleeds’s picture

I just updated to the latest nightly from DC3 (having kept my system up to date as of a couple days ago), and only now does the warning show up. So, it's narrowed down to something added by the Monday night DC3 commit.

jasonabc’s picture

Am seeing this exact error on Drupal Commons 3 (Beta 2) also. Any ideas?

Topcheese’s picture

I haven't tested it out yet, but I do believe some recent commits to the token module might fix the problem. Commons appears to be using the latest release version Token and not the latest from the Git repo.

Topcheese’s picture

@jasonabc, It's still the same issue with the latest Token and API module updates. I'll have to clean up my issue queue to try and back up to see where I'm at.

dave reid’s picture

Status: Active » Postponed (maintainer needs more info)

Make sure to be looking at the hook_token_info and hook_token_info_alter() code of these modules only, which is where this error would come from.

escapesequence’s picture

Had same problem on new install of DC-3.0

Topcheese’s picture

I hope to get a chance to look into this more. This is what I'm looking into so far.
Missing bundle property on entity of type taxonomy_term and perhaps this Taxonomy Formatter.

TygrLili’s picture

Title: token types are not defined but have tokens: taxonomy_term » Good to Know....

...that this is a known issue, not a me-noob issue, as I'm getting so used to experiencing with trying to figure DC3 out.

Okay, I'm having the same issue with my DC3 install but it gets worse; I'm hoping it's not inappropriate to add this here but I have to assume that if it's the DC installation, maybe there's a connection since I wasn't getting this error before:

Upload progress	Not enabled
Your server is capable of displaying file upload progress through APC, but it is not enabled. Add apc.rfc1867 = 1 to your php.ini configuration. Alternatively, it is recommended to use PECL uploadprogress, which supports more than one simultaneous upload.

Truthfully, I doubt that it's related, given my research that indicates that this issue is unrelated to Drupal -- but as I'm not familiar with Terminal and root access and all the information I've found, I'm not totally sure what's what here.
If this is unrelated to the Token problem with DC3, deepest apologies for the distraction.

In any case, here's to hoping for help with both problems. o.0

anrikun’s picture

Title: Good to Know.... » token types are not defined but have tokens: taxonomy_term
quiethero’s picture

Same exact problem after installing DC.

$info['types']['taxonomy_term']

japerry’s picture

Status: Postponed (maintainer needs more info) » Active

I think I found our culprit for DC3..

https://www.evernote.com/shard/s12/sh/ddfb6c56-8d16-4d34-a018-ad4ad2c026...

function commons_follow_term_flag_default_flags() {
  $flags = array();
  // Exported flag: "Topics you follow".
  $flags['commons_follow_term'] = array(
    'content_type' => 'taxonomy_term',
    'title' => 'Topics',
    'global' => '0',
    'types' => array(
      0 => 'topics',
    ),
.....

I'll continue this discussion over in the commons thread, but it looks like some custom flags we're making is causing this error to occur.

I guess flags are creating tokens on the fly, and since taxonomy_term is an entity type, its being flagged as a token type as well?

freiwerk’s picture

same problem here with Drupal Commons 7.2...

quiethero’s picture

Same problem

The following token types are not defined but have tokens:

$info['types']['taxonomy_term']

pmagi’s picture

same problem
The following token types are not defined but have tokens:

$info['types']['taxonomy_term']

japerry’s picture

Status: Active » Closed (duplicate)
Chris Charlton’s picture

Issue summary: View changes

FWIW, this post has a good suggestion on tracing where it's coming from: https://www.drupal.org/node/2750053

Tamanda’s picture

Update: I found this issue which I think I should have commented on instead. Appologies.
----------
Hi,

I'm experiencing the same but do not have Commons installed. Using Drupal 7 (latest version)and all up to date modules including Drupal Commerce suite . Errors showing on status page:

Token types are not defined but have tokens
$info['types']['node']
$info['types']['term']
$info['types']['vocabulary']
$info['types']['file']
$info['types']['user']
$info['types']['current-user']

Tokens or token types missing name property
$info['types']['date']
$info['tokens']['node']['url']
$info['tokens']['file']['size']
$info['tokens']['user']['url']
$info['tokens']['date']['custom']

It's worth noting that I noticed these errors after I reinstalled my xampp stack and re-configured my drupal site from a backup. I had some permissions issues but resolved those... however, this is the outstanding issue. I'm going to follow #21 to see if I can narrow down what's causing it.