I have drupal 5.1 running on Debian (Linux debianlamp 2.4.27-3-686 #1 Tue Dec 5 21:03:54 UTC 2006 i686 GNU/Linux) with MySQL (mysql Ver 14.12 Distrib 5.0.32, for pc-linux-gnu (i386) using readline 4.3) and php (PHP 5.2.1-0.dotdeb.1 with Suhosin-Patch 0.9.6.2 (cli) (built: Feb 9 2007 04:46:32) Copyright (c) 1997-2007 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies). I'm trying to figure out how the Forms API works. I'm doing something that an example makes look valid, but it's actually causing segmentation faults.
Below is the full code of the module. Just visiting the page that generates the form causes the segfault.
<?php
/**
* Implementation of hook_menu
* @return menu items
*/
function spew_menu() {
$items = array();
$items[] = array(
'path' => 'spew',
'title' => t('Spew form!'),
'callback' => 'spew_form_test',
'access' => user_access('access administration pages'),
'type' => MENU_NORMAL_ITEM,
);
return $items;
}
/* form test */
function spew_form_test($first = '', $second = '') {
$form['first'] = array(
'#type' => 'fieldset',
'#title' => t('First field'),
'#default_value' => $first,
);
$form['second'] = array(
'#type' => 'fieldset',
'#title' => t('Second field'),
'#default_value' => $second,
);