drupaldrupal-7drupal-hooksdrupal-blocks

Custom block not displaying


I created a custom block for my Drupal 7 install like this:

/*
 * Implements hook_block_info
 * To create a block to display the information for planB in the footer.
 */

function planb_block_info() {
  $blocks['planb_footer'] = array(
    'info' => t('PlanB Footer'),
    'status' => true,
    'weight' => 0,
    'visibility' => 1,
  );
  return $blocks;
}

function planb_block_view($delta = '') {
  switch($delta) {
    case 'planb_footer':
      $block['subject'] = NULL;
      $block['content'] = footer_block_content($delta);
      return $block;
      break;
  } 
}

function footer_block_content($delta) {
  return array('#markup' => theme('footer'));
}

Now, in my local testing environment the footer appears correctly. However, when I upload the module file to the production environment the footer doesn't appear anywhere. It doesn't even appear on the Blocks page, it's almost as if the hook is not registering with Drupal. Does anyone have any idea what I might have overlooked?

I've cleared the cache.


Solution

  • I've still not found out what was wrong with this but instead reverted to creating a footer via the GUI in the Drupal administration.