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?
1 Answer
$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 callmodule_implements('tokens')
, then the list is complete. Otherwise, it lists just my module. I cannot explain why.– linkyndyCommented Oct 15, 2012 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. Commented Oct 15, 2012 at 13:42
-
module_implements($hook, $sort = FALSE, $reset = FALSE)
with the last parameter set to false and immediately callmodule_implements('tokens')
, then the list is complete. Otherwise, it lists just my module. I cannot explain why.