Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
See meta issue #1373884: [meta] Core does not use hook_hook_info().
See also #2233261: Deprecate hook_hook_info()
Core modules should support hook_hook_info(), even if not implemented in core code usage.
Comment | File | Size | Author |
---|---|---|---|
#10 | 1375016-10.patch | 837 bytes | rpayanm |
Comments
Comment #1
agentrickardAnd a patch.
Comment #2
marcin.wosinek CreditAttribution: marcin.wosinek commentedWorks.
Patch rerolled.
Comment #3
catchThis lets you put all your comment stuff in a separate include in case comment module is disabled, but it's grouping very rare things like delete with view, so if comment module is enabled, all that code is going to be loaded again just because one is, but now with the extra overhead of an additional include etc.
I'm also not really keen in general on having hook_hook_info() implemented by every module, since it has no way at all to deal with dynamic hook names yet. Most of these hooks are or will be implemented generically by the entity system (hook_comment_load() already is), so really entity module ought to be able to dynamically handle that, but it can't, much less arbitrary things like hook_form_FORM_ID_alter().
So.. I think we should re-visit hook_hook_info() - what the patterns should be, whether we could reverse it to allow modules to explicitly register hook implementations instead (or require explicit registration which is being discussed elsewhere).
Comment #4
agentrickard@catch
#1373884: [meta] Core does not use hook_hook_info() is the meta issue. These sub-issues were all actually stalled based on sun's objections.
Comment #4.0
agentrickardChanges issue reference.
Comment #7
alansaviolobo CreditAttribution: alansaviolobo commentedComment #8
marthinal CreditAttribution: marthinal commentedSee #2233261: Deprecate hook_hook_info()
Comment #9
kerby70 CreditAttribution: kerby70 commentedAdding relationships and not in summary.
Comment #10
rpayanmComment #11
dawehnerComment #14
dpi