Closed (duplicate)
Project:
Drupal core
Version:
10.1.x-dev
Component:
extension system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
17 Dec 2011 at 15:09 UTC
Updated:
8 Mar 2023 at 15:38 UTC
Jump to comment: Most recent
Comments
Comment #1
agentrickardMoving to #1107528: Stop using magic functions and force modules to declare the hooks they want to implement.
Meta webmaster issue: we don't do partial search string matching? hook_info search doesn't match hook_hook_info?!?
Comment #2
agentrickardMoving back. The above issue is not related.
Notes from @sun on the other issue:
IMO, we should take the low-hanging tasks first: actually use the hook. Then solve the other problems.
Comment #3
sunMy hope for advancing further on hook_hook_info() is essentially blocked on #977052: Implement hook_hook_info() for Field API hooks -- unless that lands, I don't see a point in adding hook_hook_info() elsewhere.
Comment #4
agentrickardI see a couple of reasons for it:
I would not hold up advancements -- like moving aggregator functions, which are rarely used -- just because of the most difficult edge case. That approach is the enemy of progress.
Note that I just want to register the hook right now, not actually start moving functions around in core.
Comment #5
ralf.strobel commentedI can only see a few (but large) groups of hooks in the core modules that would make ideal candidates for lazy loading. I would go as far as saying that if they were dealt with, the rest almost seems negligible...
For (1) one could think about canonizing the module.info.inc files that Entity API has introduced, through an "info" group in hook_hook_info().
For (2) a file module.admin.inc seems logical, the way that some modules already introduce it. It might even make sense to load it not hook-based but whenever a page request path begins with "/admin", so that developers can effectively move all non-fontend code out of their main files.
Group (3) makes sense as read operations far outweigh the write operations on most sites, while write operations are usually responsible for more of the code.
If these three groups of hooks were eliminated, my main module files would shrink a lot, leaving mostly stuff that really is required by almost all page requests.
Comment #6
pounardI'll all for this issue, especially for the field module.
Comment #7
pounardI'm OK with the 1) group.
The "info" group sounds about right, but only for those who cache results. For exemple, hook_element_info() (or hook_elements() I don't remember) should stay in the .module files because it's not cached (and there is probably no need to cache it anyway).
Comment #7.0
pounardUpdates progress.
Comment #7.1
Anonymous (not verified) commentedAdded RDF module issue.
Comment #7.2
xanoLinked to child issue for user.module.
Comment #8
mikeytown2 commentedan update to this is views in core does this as well.
http://api.drupal.org/api/drupal/core!modules!views!views.module/functio...
Any reason why we don't have cron group?
Comment #8.0
mikeytown2 commentedLinked to child issue for node.module.
Comment #9
sunI think
hook_hook_info()is obsolete for D8, so I've created#2233261: Deprecate hook_hook_info groups, mark hook_hook_info() for deletion
I was tempted to directly proceed and close this meta + all the child issues, but postponing that until there's community agreement on that stance.
Comment #16
andypostComment #24
andypostClosing in favour of #2233261: Deprecate hook_hook_info groups, mark hook_hook_info() for deletion