I have a custom module which has some custom blocks in. My blocks display in the block page so they are being registered with hook_block_info.

However my modules are not displaying anything on the screen. I have added a dpm('hit') at the the top of hook_block_view for my module but nothing is being displayed.

I have added hook_block_view_alter to my module and see that the blocks are being displayed there but with the $data parameter being null/empty.

I have run my code through the coder module and it is not seeing any errors.

What could be going wrong?

  • Can you show your code? Difficult to debug without that. BTW The coder module won't tell you if your code's correct, just whether on not it conforms to Drupal's code standards
    – Clive
    Commented Jul 22, 2013 at 11:24

1 Answer 1


After looking around the code I ended up the _block_load_blocks function. Before calling drupal_alter('block_list', $block_info); I had 6 elements in $block_info. After the function had run I had 2 items.

Doing some digging in drupal_alter I fount out what modules were touching $block_info. The domain module was removing the blocks.

Looking at the settings on the block page I did not have my domain ticked. The message under the domain options did say:

Limit block display to these affiliates. This block is visible on all domains by default using this theme.

So thought the block would appear by default. This was not the case.

  • Thanks for bring up this response. Keep contributing to the Drupal.SE community. Commented Oct 15, 2013 at 18:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.