A lot of modules I see -- mine included -- check to see if the block content they generate is empty in hook_block before setting $block['content'] and $block['subject'].
As far as I NOW know, this isn't necessary -- you can just set content and subject and Drupal core will take care of not showing anything if the content is empty.
This detail could do to be added to the docs for this hook.
Comments
Comment #1
karschsp commentedtagging for novice queue
Comment #2
kresimir commentedComment #3
kresimir commentedIn the function hook_block_view documentation, it already states:
'If the "content" element is empty, no block will be displayed even if "subject" is present.'
http://api.drupal.org/api/function/hook_block_view/7
Comment #4
joachim commentedLooks like it's already been fixed!
And backported to 6 too: http://api.drupal.org/api/function/hook_block
Could backport to 5 I suppose -- I don't know if there's a policy on whether to do that or not though.
Comment #5
catchComment #6
jhodgdonIt's been fixed in Drupal 5 as well.