hook_block_view() should not return null

Created on 1 June 2018, about 6 years ago
Updated 4 February 2024, 5 months ago

Hi,

We are using the FacetAPI module and a Drupal theme with strict typing in parameters of preprocess hooks.

So, we are using [theme]_block_view_alter(array &$build, $block) in our theme.

However, this module is not returning an array in facetapi_block_view() and it can lead to some issue on our sites.

According to the official documentation, hook_block_view() is supposed to return an empty array instead of null.

The following one-line patch will fix this issue.

Original issue on Github: https://github.com/ec-europa/atomium/issues/113

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium Pol Brussels

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024