1

I've declared a [module-name]_tokens() hook but when I output the contents of module_implements('tokens'), only my module appears in the list. I know that there are many more modules that implement hook_menu(); why do I get only my module listed? Where shall I look for possible errors?

0
$hooks = module_implements('tokens');
print_r($hooks);

It returns the follwoing

Array ( [0] => token [1] => date [2] => domain [3] => entity_token [4] => facetapi [5] => logintoboggan [6] => name [7] => node [8] => scheduler [9] => system [10] => taxonomy [11] => token_custom [12] => user [13] => views [14] => field [15] => menu )

The only place which i see is it is cached, try clearing the cache or try the following

 module_implements('tokens', FALSE, TRUE)

The third params is reset to reset the cache.

  • Tried that. Only if I call module_implements($hook, $sort = FALSE, $reset = FALSE) with the last parameter set to false and immediately call module_implements('tokens'), then the list is complete. Otherwise, it lists just my module. I cannot explain why. – linkyndy Oct 15 '12 at 13:37
  • If you have tried the same in a separate file and got the same result, Then i am sorry i do not have much idea in it. – Dinesh Kumar Sarangapani Oct 15 '12 at 13:42
  • Unfortunately, it doesn't work :( – linkyndy Oct 15 '12 at 15:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.