hook_block_view_alter accepts 2 arguments:

$data: An array of data, as returned from the hook_block_view() implementation of the module that defined the block:

$block: The block object, as loaded from the database, having the main properties:

However, in some cases ctools calls this function with 2 objects, instead of an array and an object. I believe this is the cause of the WSOD issue described at #1586876: Not compatible with Login block in Panels (anonymous see white screen). It manifests itself if you have modules that implement hook_block_view_alter and you try to put the user login block into a panel pane, and then view it as an anonymous user.

If hook_block_view_alter is to be called, then it needs to be done so with the correct paramaters.

Files: 
CommentFileSizeAuthor
#1 1605804.1-ctools-block-view-alter.patch889 bytesmrfelton
PASSED: [[SimpleTest]]: [MySQL] 51 pass(es).
[ View ]

Comments

Status:Active» Needs review
StatusFileSize
new889 bytes
PASSED: [[SimpleTest]]: [MySQL] 51 pass(es).
[ View ]

Attached patch ensures that hook_block_view_alter is called correctly.

Status:Needs review» Reviewed & tested by the community

Great catch, mrfelton.

This will fix the API implementation *and* not cause any problems with CTools' use of the block as it is converted to an object in the very next line.

Status:Reviewed & tested by the community» Fixed

Seems reasonable. Committed and pushed.

cool

--author="mrfelton <mrfelton@305669.no-reply.drupal.org>"

Status:Fixed» Closed (fixed)

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

Issue summary:View changes

Fix typo