My module is producing this error repeated four times when you visit it's block's configuration page:

warning: Cannot use a scalar value as an array in /home/mysite/public_html/includes/form.inc on line 1583.

Any idea what could be generating that? I'm not exactly sure where to look. Here's my block code:


/**
 * Implementation of hook_block().
 */
function forward_block($op = 'list', $delta = 0, $edit = array()) {
  switch ($op) {
    case 'list':
      $blocks[0]['info'] = t('Most Emailed');
      return $blocks;
    case 'configure':
      $block_options = array(
        'today' => t('Most Emailed Today'),
        'week' => t('Most Emailed This Week'),
        'allTime' => t('Most Emailed of All Time'),
        'recent' => t('Most Recently Emailed')
      );
      $form['forward_block_type'] = array(
        '#type' => 'radios',
        '#title' => t('Block Type'),
        '#default_value' => variable_get('forward_block_type', " "),
        '#options' => $block_options,
        '#description' => t('Choose the block type'),
        '#required' => null,
        '#attributes' => true,
      );
      return $form;
    case 'save':
      variable_set('forward_block_type', $edit['forward_block_type']);
      break;
    case 'view':
      ...
  }
}

I removed the view code from this sample since it's large and irrelevant. The error only appears in the configure op.

Comments

bleak26’s picture

I had this yesterday when i accidentally used a TRUE instead of an array.