This is a weird bug. We've only seen it on a single site at the moment, but it's absolutely consistent. Posting here partly to see if others have encountered the issue.

Description

When we use the Drush admin_menu item "Flush all Caches" (i.e., on drupal_flush_all_caches()), tokens will no longer be replaced—apparently in any context—until the cache is cleared (i.e. until cache_clear_all() runs). Tokens are not replaced when token_replace() is invoked, so we find instances of, e.g. [token] in text, emails etc. This happens consistently in Webforms, rules and custom modules (and continues when our token-using custom modules are disabled).

Has anyone else seen this?

Comments

nilsbunger’s picture

I think I just hit this same issue on our site, but I know less about it than you do. Using the GUI admin panel, I was able to get tokens to appear again by running "cache clear" (in Configuration / Development / Performance) followed by a "flush all". Why this happened, I don't understand. What's the difference between a cache clear and a cache flush?

I'll update this item if I figure out anything else about it...

StuddMan’s picture

We are having the same issue, something happens to the site and all of sudden we start seeing tokens fields everywhere (i.e. [token]) instead of the actually token value. Clearing caches from Admin Menu or Development-> Performance -> Clear Caches does not work. The only thing we have been able to get the site working again is with a drush cc all. This is a major issue because once the tokens die it affects all kinds of things including our Drupal Commerce checkout progress, no one can checkout.

StuddMan’s picture

We continue to be plagued by this issue, Page title tokens and user tokens stop being replaced and functionality of the site is affected. We have found flushing the token registry from the Admin menu seems to get the tokens back. Any ideas?

Dave Reid’s picture

Issue summary: View changes
Status: Active » Closed (cannot reproduce)

It probably means you have some kind of code somewhere that invokes a hook too early (before Drupal has been fully bootstrapped). I ran into this as well when running drush updatedb and had to fix it there: https://github.com/drush-ops/drush/pull/399

I've never found this problem is caused by Token module though.

khoomy’s picture

Hi

I am facing same issue with panels and tokens in rules. Token replacement stop working sometime but when I cleared the cache manually it starts working.