- πΊπΈUnited States smustgrave
Closing as it appears hook_info is being deprecated in https://www.drupal.org/project/drupal/issues/2233261 π Deprecate hook_hook_info() Active
So this may be treading back towards the registry, but currently it's impossible for Token module β to easily tell the module hook system that it has the menu, profile, and field implementations for tokens. Currently with module_implements we cache discovered implementations like this:
$implementations[hook][module] = FALSE; // Means the hook is located in the module file. Since all module files are loaded on full bootstrap, we don't care where the hook is located.
$implementations[hook][module] = 'group' // Means the hook is located in module.group.inc inside the module's root directory. This group values is taken from hook_hook_info().
Now if we stored the actual file location instead of 'group', it could allow modules to easily add core module support for hooks. In the case of token.module, we'd want to do something like this:
function token_module_implements_alter(&$implementations, $hook) {
if ($hook == 'tokens' || $hook == 'token_info') {
$modules = array('menu', 'profile', 'field');
foreach ($modules as $module) {
if (module_exists($module) && $file = module_load_include('inc', 'token', $module . '.tokens')) {
$implementations[$module] = $file;
// Ensure this gets cached since we made changes.
$implementations['#write_cache'] = TRUE;
}
}
}
}
Closed: duplicate
11.0 π₯
Last updated
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Closing as it appears hook_info is being deprecated in https://www.drupal.org/project/drupal/issues/2233261 π Deprecate hook_hook_info() Active