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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Patch 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.

alexpott’s picture

Oops forget to enable the module - the test still fails as expected though...

alexpott’s picture

Here's a patch with a fix.

The last submitted patch, 2: 2707261-2.test-only.patch, failed testing.

The last submitted patch, 3: 2707261-3.test-only.patch, failed testing.

jhodgdon’s picture

Status: Needs review » Postponed

This 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.

alexpott’s picture

Version: 8.2.x-dev » 8.1.x-dev
Status: Postponed » Needs review
FileSize
4.55 KB
5.74 KB

The last submitted patch, 8: 2707261-8.test-only.patch, failed testing.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

What's not to like? :) Good, clean code. With test. Fixes bug. Let's do it.

catch’s picture

Status: Reviewed & tested by the community » Needs work
alexpott’s picture

Status: Needs work » Needs review
FileSize
950 bytes
5.78 KB

@catch - good catch.

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!

  • catch committed 1003490 on 8.2.x
    Issue #2707261 by alexpott, jhodgdon: Calling moduleInvokeAll in Help...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.2.x and cherry-picked to 8.1.x. Thanks!

Status: Fixed » Closed (fixed)

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