This is just a report from a super complicated site. Feel free to close afterwards, as I can not give steps to replicate (well I haven't tried on a simple site).

I defined some additional file tokens, in module.tokens.inc.
Using module_hook_info() I added token_info & tokens, setting the group to 'tokens'.

After flushing the cache, I lost most of the tokens in the site.

During debugging, a dpm in token.tokens.inc (Token module), resulted in a call to token_token_info() on every page load, however my custom hook callback was only called during a cache flush.

To resolve, I simply removed the callbacks in hook_info() and cut and pasted the code into the main module file.

Since, the last step rules out issues with my code (dpm in both functions was called occasionally when using the hook_info) there is something in MemCache / Pressflow, Domain Access, Entity Tokens, Core or the Token module misbehaving. Dependencies on this complicated site meant that I could not disable and test the cause (well I didn't have the time too)

As I say, it is just a notification in case something comes to mind. My workaround is fine (within the core module file), as the file tokens can be used lots& just 50 loc and the token info hook is only 5 loc.

Comments

Dave Reid’s picture

Status: Active » Fixed

Using module_hook_info() I added token_info & tokens, setting the group to 'tokens'.

This here is the key. System module already defines this token group so by doing so again, the result of module_invoke_all() now causes an array merge, and loading the hooks from the modulename.tokens.inc files will no longer work.

Alan D.’s picture

Thank you so much. I have misread the API page may times over!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.