Posted by Noe_ on November 8, 2011 at 8:15pm
6 followers
| Project: | Token |
| Version: | 7.x-1.0-beta7 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
Hello,
I am running token 7.x 1.0 beta 7, but there are no tokens available.
See attached screenshot about which tokens are available. But for example no node anything, while I would like to use [node:title].
The thing is I cannot reproduce it. It is just not available on this site, but not on any other.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| available_tokens.jpg | 22.11 KB | Ignored: Check issue status. | None | None |
Comments
#1
Maybe you might need to clear your site's cache. Which module is displaying this list of tokens?
#2
I just know which module provides the google analytics tokenizer tokens, that is the google analytics tokenizer module.
By the way, I uninstalled that module.
I did clear the cache and that resulted in errors, see attached screenshot.
And in case you were wondering I still don't have the node:title
Isn't that (node:title) provided by the token module?
#3
For the new errors, it sounds like a module isn't providing the right data in hook_token_info(). You may be able to check the admin/reports/status to check which tokens are the problem.
#4
Hey that's it !!
The following 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']
But now for the inevitable question: What to do now?
Could you point me in the right direction?
#5
Ok this is what I found so far:
Correct me if I am wrong.
Well you probably know that all of the above tokens are generated by the token module.
So I downloaded the latest dev version of token to see if the problems there still exist, they do.
Then I enabled the testing module, and tested the token module.
There are two failed tests as you can see in the screenshot.
#6
That's very odd. There's no reason that those token types shouldn't be defined - those are defined by core modules. Also, I'm not sure that test will pass since it seems to be running on a production site.
Are you able to duplicate this on a fresh install of Drupal core + Token module only?
#7
Nope, I cannot.
That means the code is correct, right?
So there must be something wring in the database?
Or are there any other possibilities?
I think it started when I upgraded from Drupal 6 to Drupal 7
#8
I ran into a situation where there were no tokens displayed for nodes until I ran the token_clear_cache() function with drush. For example:
drush ev "token_clear_cache();"Is there a reason this can't be included in the token_flush_caches() function, so it's included when clearing all caches?
#9
This didn't help me though.
I ran it and when I returned to admin/config/search/path/patterns I got the following errors:
Notice: Undefined index: name in token_asort_tokens() (line 464 of /www/wiredpea/sites/all/modules/token/token.module).Notice: Undefined index: name in token_asort_tokens() (line 464 of /www/wiredpea/sites/all/modules/token/token.module).
Notice: Undefined index: name in token_asort_tokens() (line 464 of /sites/all/modules/token/token.module).
Notice: Undefined index: name in _token_token_tree_format_row() (line 135 of /sites/all/modules/token/token.pages.inc).
Notice: Undefined index: description in _token_token_tree_format_row() (line 136 of /sites/all/modules/token/token.pages.inc).
Notice: Undefined index: name in _token_token_tree_format_row() (line 135 of /sites/all/modules/token/token.pages.inc).
Notice: Undefined index: description in _token_token_tree_format_row() (line 136 of /sites/all/modules/token/token.pages.inc).
Notice: Undefined index: name in _token_token_tree_format_row() (line 135 of /sites/all/modules/token/token.pages.inc).
Notice: Undefined index: description in _token_token_tree_format_row() (line 136 of /sites/all/modules/token/token.pages.inc).
#10
#11
@Noe_ Check your admin/reports/status page then. It should tell you which tokens are incorrectly defined.
#12
Warning
Tokens Problems detected
The following tokens or token types are missing required name and description information:
* $info['types']['date']
* $info['tokens']['node']['url']
* $info['tokens']['file']['size']
* $info['tokens']['user']['url']
* $info['tokens']['date']['custom']
The following 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']
#13
I'm having some very odd activity similar to the issues discussed here. Tokens were working fine and the, all of a sudden, not generating. This is affecting backup & migrate, menu path, path and node title token profiles. This simply stop working.
Tokens start working again when I all token_clear_cache(); per comment #8 above.
I didn't have cron running on this site yet (it's in development), but I've now set it up to run every hour hoping it will flush the token cache enough so that I never see this issue.
I had been using beta7, but as of now, I've upgraded to the December 14, 2011 version of dev.
#14
Reporting back after having installed the DEV version and started my crontab to run every hour. 14 minutes after the cron ran, I did a backup using backup & migrate. The token in the file name for the backup did not get processed. Bummer.
I ran drush ev "token_clear_cache();" and that got things back on track, but this is a very worrisome issue since a lot of my user experience relies up on this. (Panel variants that are looking for specific paths. If the path is not generated correctly by tokens, then the panel variant will not appear.)
#15
Having a similar issue with drupal 7.12 and token 7.x-1.0-rc1
Once clearing the cache I'm getting "Tokens not available" messages on tokens list (on page title modules settings for example"
When I use DEVEL to re-install "token" module, tokens are back, till next cache clear. Since we are still on development, we clear the cache quite often.