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.
Follow-up to #2707109: Help block should not be displayed when hook_help() implementations return an empty string
Problem/Motivation
moduleInvokeAll merges the return values if they are arrays. So if two hooks return [#markup => 'something'] I'm not sure what is going to happen.
Proposed resolution
Call each hook individually
Remaining tasks
User interface changes
None
API changes
@todo
Data model changes
None
Comment | File | Size | Author |
---|---|---|---|
#12 | 2707261-12.patch | 5.78 KB | alexpott |
#12 | 8-12-interdiff.txt | 950 bytes | alexpott |
#8 | 2707261-8.patch | 5.74 KB | alexpott |
#8 | 2707261-8.test-only.patch | 4.55 KB | alexpott |
#4 | 2707261-4.patch | 8.2 KB | alexpott |
Comments
Comment #2
alexpottPatch attached is a failing test built on top of #2707109: Help block should not be displayed when hook_help() implementations return an empty string as that adds simple help block test coverage. The do-not-test.patch shows the relevant additions.
Comment #3
alexpottOops forget to enable the module - the test still fails as expected though...
Comment #4
alexpottHere's a patch with a fix.
Comment #7
jhodgdonThis looks great! Good catch also. I am ready to RTBC it, but it looks like we should wait for #2707109: Help block should not be displayed when hook_help() implementations return an empty string to be finished, at which point it will need a reroll because this patch includes the patch from that other issue.
Comment #8
alexpottI think this fix is patch eligible. Rerolled now that #2707109: Help block should not be displayed when hook_help() implementations return an empty string has landed.
Comment #10
jhodgdonWhat's not to like? :) Good, clean code. With test. Fixes bug. Let's do it.
Comment #11
catchI think this should use https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Extension!ModuleH...
Also see #2616814: Delegate all hook invocations to ModuleHandler.
Comment #12
alexpott@catch - good catch.
Comment #13
jhodgdonThanks!
Comment #15
catchCommitted/pushed to 8.2.x and cherry-picked to 8.1.x. Thanks!