I have a form which works fine in D6, but not in D7.
In D7 I just get the error message:
Notice: Undefined index: vchess_new_game_form in drupal_retrieve_form() (line 750 of C:\ProgramData\Apache Group\www\chess_drupal_7\includes\form.inc).
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'vchess_new_game_form' was given in drupal_retrieve_form() (line 785 of C:\ProgramData\Apache Group\www\chess_drupal_7\includes\form.inc).
What do I need to change for Drupal 7 forms API vs. Drupal 6 forms API?
Following is the code I am using:
function vchess_menu(){
$items = array();
...
$items['vchess/newgame_form'] = array(
'page callback' => 'drupal_get_form',
'access arguments' => array('access content'),
'page arguments' => array('vchess_new_game_form'),
'title' => t('Create VChess chess game'),
'type' => MENU_CALLBACK,
);
...
return $items;
}
/**
* menu callback vchess_new_game_page to display new game form
*/
function vchess_new_game_form()
{
$colors = array('w'=>t('white'),'b'=>t('black'));
$form['colorfield'] = array(
'#type' => 'fieldset',
'#title' => t('Choose your color'),
);
$form['colorfield']['color'] = array(
'#type'=> 'radios',
'#default_value' => 'w',