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();

Comments

sun’s picture

Why 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. ;)

dave reid’s picture

sun’s picture

Assigned: Unassigned » sun
Status: Active » Needs review
StatusFileSize
new6.07 KB

I 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 for if ($this->hookInfo) instead of using isset(). 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.

sun’s picture

StatusFileSize
new5.54 KB

And it probably helps to pull HEAD. ;)

sun’s picture

#4: drupal8.module-hook-info.4.patch queued for re-testing.

sun’s picture

@Dave Reid: Are you happy with this patch? If so, can we move forward here?

dave reid’s picture

Status: Needs review » Reviewed & tested by the community

Yep, this seems reasonable.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.