[support] Problem with hook_block

Fred Jones fredthejonester at gmail.com
Mon Aug 23 14:22:59 UTC 2010


Here is my code:

function my_pic_block($op = 'list', $delta = 0, $edit = array()) {
  switch ($op) {
    case 'list':
      $blocks[0]['info'] = t('My Reports');
      return $blocks;
    case 'view':
      switch ($delta) {
        case 0:
          $block['subject'] = t('Title of configurable-text block');
          $block['content'] = my_pic_report_block_content();
          break;
      }
      return $block;
  }
}

I think that's quite simple and "textbook." And on my local test site
it works fine. On the online test site, however, it doesn't work. I
don't see 'My Reports' on my Blocks page. So I put this line

      echo 1;die;

after

  case 'list':

and I refresh admin/build/block and I see a 1 in my browser. So the
code is being executed. And I am logged in as user #1. Also, on my
local site, not only do I see it in my block list, but on the Pic page
(where the block is activated) I see the correct content--my function
my_pic_report_block_content works here.

Can anyone suggest why this is failing on the dev server? I'm a bit confused...

Thanks.


More information about the support mailing list