Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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.
Comment | File | Size | Author |
---|---|---|---|
#5 | failed-test.png | 89.75 KB | Noe_ |
#2 | new_errors.jpg | 101.05 KB | Noe_ |
available_tokens.jpg | 22.11 KB | Noe_ |
Comments
Comment #1
Dave ReidMaybe you might need to clear your site's cache. Which module is displaying this list of tokens?
Comment #2
Noe_ CreditAttribution: Noe_ commentedI 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?
Comment #3
Dave ReidFor 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.
Comment #4
Noe_ CreditAttribution: Noe_ commentedHey that's it !!
But now for the inevitable question: What to do now?
Could you point me in the right direction?
Comment #5
Noe_ CreditAttribution: Noe_ commentedOk 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.
Comment #6
Dave ReidThat'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?
Comment #7
Noe_ CreditAttribution: Noe_ commentedNope, 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
Comment #8
arithmetric CreditAttribution: arithmetric commentedI ran into a situation where there were no tokens displayed for nodes until I ran the token_clear_cache() function with drush. For example:
Is there a reason this can't be included in the token_flush_caches() function, so it's included when clearing all caches?
Comment #9
Noe_ CreditAttribution: Noe_ commentedThis didn't help me though.
I ran it and when I returned to admin/config/search/path/patterns I got the following errors:
Comment #10
badrun CreditAttribution: badrun commentedComment #11
Dave Reid@Noe_ Check your admin/reports/status page then. It should tell you which tokens are incorrectly defined.
Comment #12
Noe_ CreditAttribution: Noe_ commentedComment #13
capellicI'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.
Comment #14
capellicReporting 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.)
Comment #15
fatfish CreditAttribution: fatfish commentedHaving 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.
Comment #16
Roulion CreditAttribution: Roulion commentedI en counter the same issue on a multisite environnement. The strangest thing is my fisrt sites (in D6->D7 migration) works fine, and the second, wich is a fresh install does't work...
I use token 7.1.1.
I also noticed when i istall other modules like RDF the pb desapper till à clear cache...
Comment #18
Roulion CreditAttribution: Roulion commentedOK it looks like the issue about missing token $info['types']['file'] comes from file (field) path module.
When i desactivate it, the issue disappear
I use this module with some patch abourt a regex pb and multivalue field (issue #1512466: Multivalue field : only the first field is correctly treated and #1355170: All text-based fields wiped empty after replacing a file in a node and saving.). I will create an issue on filefield module
Comment #19
moniuch CreditAttribution: moniuch commentedI have a similar situation in Token 1.1. The errors in status - they all point to (allegedly) multivalue fields.
I say 'allegedly' because body is a single value field and I have:
What is weird is that every field that is listed 4 times, with indices 0...3.
Plus, at the very bottom:
The following token types are not defined but have tokens: $info['types']['taxonomy_term']
Comment #20
trillex CreditAttribution: trillex commentedI can confirm this in the latest dev as well. It's affecting Page Titles and Heartbeat. My token list is also empty except for the Google Analytics token, described above. Other than that, I don't have anything else to add.
Comment #21
webmaster-eddie CreditAttribution: webmaster-eddie commentedSubscribe
Same problem, but it is only happening on the site(s) i run that have the most going on - i.e. the most content and the most modules enabled. Clearing the cache sometimes works, but problem re-appears very quickly.
The drush command
drush ev "token_clear_cache();"
solves this problem for me every time, but within an hour the problem re-appears.
Comment #22
advantopher CreditAttribution: advantopher commentedi've the same problem as #19.
the error report shows
the error appeares with standard elements as well as manually added elements (e.g. added fields).
there are 72 lines of error messages.
clearing the cache doesn't have any effect.
Thanks for any solution
Comment #23
trillex CreditAttribution: trillex commentedComment #24
davipilot CreditAttribution: davipilot commentedI also have the same issue as above. Running Token 7.x-1.1 and Drupal 7.14.
Comment #25
Dave ReidYou'd have to check with module is adding tokens like [node:body:0:key] because it's not Token module itself. It's trying to warn you about a problem with whatever module defines them.
Comment #26
advantopher CreditAttribution: advantopher commentedI'm not sure if this is a solution for anyone, but my problem is solved.
within this token-problem I had a few other ones that I worked with.
when I updated drupal 7.14 to 7.15 and deleted the etracker module (7x-dev) the "token-problem" no longer appeared.
I hope this may help!
Comment #28
axxint CreditAttribution: axxint commentedRunning Drupal 7.9. This error started happening immediately after running update.php for a Devel update: "Convert devel_error_handler variable to devel_error_handlers array" (http://api.drupalize.me/api/drupal/function/devel_update_7004/7). I have confirmed that one of our custom modules is triggering "The following token types are not defined but have tokens:$info['types']['user']"; however everything was working fine with our module and Tokens before that Devel update. We've disabled Devel and the error is still there - so maybe it has something to do with the database? Also, tokens across the board are not working, not just user tokens for which we're getting the error in our status report, but when we disable our custom module, all tokens are working again.
Comment #29
filsterjisah CreditAttribution: filsterjisah commentedI have had the same problem, on "admin/config/people/accounts" there was the message "There are no tokens available". I'd tried everything with token & caching of token tree (static / db) and still no result.
It seemed to be that there was a none-relevant function call that caused the problem. It had byref parameters. In the function definition there were also byref parameters. This caused my problem.
ex.
Debug notice: "Deprecated function: Call-time pass-by-reference has been deprecated in drupal_load() (regel 1128 van .../includes/bootstrap.inc)."
The strange thing is that the function is never being called. Seems like a compilation fault...
Anyway i removed the byref in my function call and tokens got generated again...
Comment #30
adrupaler CreditAttribution: adrupaler commentedI had the same issue on "admin/config/people/accounts". I almost tried everything to solve the problem.
I've been using call by refrence which is depricated in PHP 5.4 and over.
the #29 solution solved the problem.
Comment #31
alpersari CreditAttribution: alpersari commentedhad the same issue on "admin/config/people/accounts". My Drupal is 7.24 and Token 7.x-1.5
I can not use tokens in e-mail message templates in the account settings.
Comment #32
phenaproximaI had this problem on Drupal 7.23, Token 1.5, after installing the latest version of Metatag. The solution in #8 fixed it for me.
Comment #33
lookatthosemoose CreditAttribution: lookatthosemoose commentedEnabling entity_tokens module and clearing cache fixed this for me, using Drupal 7.56 and Token 1.7.