We've implemented hook_hook_info() in D7, but somehow failed to do the same (or port that) to D8. Since we do define quite a few of them, being able to move them to a separate file does make sense, I'd say.

Comments

drunken monkey created an issue. See original summary.

drunken monkey’s picture

Status: Active » Needs review
StatusFileSize
new11.64 KB

More or less trivial patch attached.
A few notes:

  1. By moving the test modules' hook implementations, we have a simple way of testing this.
  2. Unfortunately, I don't think it's possible to add hook infos for hooks with wildcards, like our hook_search_api_query_TAG_alter(), so those two have to still be defined in the .module file. Potentially confusing, I fear, but no way around that, as far as I can see.
  3. I also moved the DB backend's sole hook into the search_api group. Makes sense to be able to have that in the same file, too, right? Other extension modules might want to do the same, I guess.
drunken monkey’s picture

Status: Needs review » Needs work

The last submitted patch, 2: 2863253-2--implement_hook_hook_info.patch, failed testing.

drunken monkey’s picture

Status: Needs work » Needs review
StatusFileSize
new443 bytes
new11.65 KB
borisson_’s picture

Status: Needs review » Reviewed & tested by the community

Looks good!

drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

Good to hear, thanks for reviewing!
Committed.

  • drunken monkey committed 04df737 on 8.x-1.x
    Issue #2863253 by drunken monkey: Added hook infos for all our hooks.
    

Status: Fixed » Closed (fixed)

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