Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
26 Jan 2013 at 07:24 UTC
Updated:
29 Jul 2014 at 21:49 UTC
Jump to comment: Most recent file
If this method is replacing module_hook_info() then I should be able to call this function without it being protected and unavailable to me:
$info = drupal_container()->get('module_handler')->getHookInfo();
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | drupal8.module-hook-info.4.patch | 5.54 KB | sun |
| #3 | drupal8.module-hook-info.3.patch | 6.07 KB | sun |
Comments
Comment #1
sunWhy would anyone want to call this method?
I'm not opposed to making it public, but I also can't see why it should be. ;)
Comment #2
dave reidUse case: #1900668: Load in component default file and filename from hook_hook_info() if available but may be nullified in Drupal 8.
Comment #3
sunI guess that makes sense.
Since it was internal/protected before, the method was located further down in the classes, so by making it public, we should move it further up. Since
getHookInfo()provides the base data for pretty much all other methods, I relocated it to the beginning of the hook-related methods.One additional bug fix:
ModuleHandler::getHookInfo()checked forif ($this->hookInfo)instead of usingisset(). This means that HEAD re-runs the code needlessly when there is no hook info. Right now, that's still rare, and probably happens in tests only, but nevertheless, should be fixed.Aside from that, no functional changes are contained.
Comment #4
sunAnd it probably helps to pull HEAD. ;)
Comment #5
sun#4: drupal8.module-hook-info.4.patch queued for re-testing.
Comment #6
sun@Dave Reid: Are you happy with this patch? If so, can we move forward here?
Comment #7
dave reidYep, this seems reasonable.
Comment #8
webchickCommitted and pushed to 8.x. Thanks!