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.
Comment | File | Size | Author |
---|---|---|---|
#1 | 1605804.1-ctools-block-view-alter.patch | 889 bytes | mrfelton |
Comments
Comment #1
mrfelton CreditAttribution: mrfelton commentedAttached patch ensures that hook_block_view_alter is called correctly.
Comment #2
DamienMcKennaGreat 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.
Comment #3
merlinofchaos CreditAttribution: merlinofchaos commentedSeems reasonable. Committed and pushed.
Comment #4
mrfelton CreditAttribution: mrfelton commentedcool
--author="mrfelton <mrfelton@305669.no-reply.drupal.org>"
Comment #5.0
(not verified) CreditAttribution: commentedFix typo