Passing arguments into hook_block_view in custom module I'd like to pass a variable ($myvariable) into the block_view function in my custom module, so i can see the content of the variable in the block content. 

But there must be something i do wrong, because the below code gives me the following error:


  Warning: Missing argument 2 for mymodule_subscribe_block_view ...


/**
 * Implements hook_block_view().
 *
 * Prepares the contents of the block.
 */
$myvariable = 'test';
function mymodule_subscribe_block_view($delta = '', $myvariable) {
  switch ($delta) {
    case 'mymodule_test':
      $block['subject'] = t('Test block');
      if (user_access('access content')) {
          // Pass data through theme function.
          $block['content'] = $myvariable;
      }
    return $block;
  }
}


I'd greatly appreciate any hints on what's going wrong here.
If you need to pass a variable into a block, maybe you should try using template_preprocess_block ?

Inside this function you define your variable and afterwards in your block you use it.