The module_invoke for hook help is generating a fatal error for modules using strict coding standards in their hook_help implementation.

The error is "Recoverable fatal error: Argument 2 passed to MODULE_help() must be an array, null given in MODULE_help()"

This is the case for the module search_api_solr for example: http://drupal.org/node/1425700

The module_invoke call in the rubik_preprocess_help_page() function should not pass NULL as an argument, as the drupal API states that the second parameter of hook_help is an array.

This is not a problem for most of the contrib modules, but if you have just one module implementing hook_help with strict coding standards, the entire help section of your site is broken.

Steps to reproduce the bug:
-install and enable module search_api_solr
-set rubik as your admin theme
-try to access any help page of any module
=> error

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jgalletta’s picture

Here's a patch correcting this issue.

I choose to pass array() to module_invoke instead of NULL assuming you did that because you wanted to clean something. Alternatively we can just remove the NULL parameter and pass nothing.

sdelbosc’s picture

Shouldn't you use drupal_help_arg() rather than array() for the 2nd argument of the hook_help() implementations?
This is what seems to be used by Drupal core:

jgalletta’s picture

Status: Active » Needs review
FileSize
569 bytes

Indeed.
Here's a patch using drupal_help_arg() like in core.

haydeniv’s picture

Status: Needs review » Fixed

Fatal errors are bad. :(
Committed #3: 03b1a96
Thanks!

Status: Fixed » Closed (fixed)

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