This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

drupal handbooks

Hi,

does anybody know how the http://drupal.org/handbooks page is created? Is there some kind of module that emulates this, or maybe a short PHP code?

Fatal error: Cannot unset string offsets in ..www\drupal\includes\form.inc on line 318

I'm trying to put a table in my module and everywhere i place it i've got this error:

Fatal error: Cannot unset string offsets in ..\www\drupal\includes\form.inc on line 318

table works on my drupal site cause I'm using other modules that got it too.. I even tried to cut and paste some code to check if i made some errors..

even if i use a simple code like this:

function print_table(){

$header = array('this', 'is', 'my', 'test');
$rows[] = array('wow', 'it', 'works', 'great!');

Cannot use a scalar value as an array in form.inc on line 1583.

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':
      ...
  }
}

Altering the User registration form using hook_form_alter

I am trying to create users from within a custom module. I want to leverage hook_user and hook_form_alter in the right way to enter users into the database and then capture additional data in custom tables I have created. I have read the documentation but have not come across any good code examples of how to do this. Can someone post a simple example of how you would add a user from within a custom module using hook_user? Sorry if this is a stupid question but my we decided to go with Drupal and then the lead programmer quit in a huff and I'm stuck trying to make the deadline.

executing function with url..

Anyone could tell me how i would execute a function i have called custom_front() ..
by going to example.com/custom_front/

and also where would i put the function ? into the template.php?

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions