Hi all,
I am using Drupal 4.7. I have a the following problem. I have defined a _menu hook function that displays a "add" tab. When clicked, the add tab should call a function that returns a form. I need to use drupal_get_form to generate the form. However when I do this I just get errors (see below). It seems the framework goes into a endless loop. There seems to be a problem with the $fomr[#parents] variable but I do not defined this myself and I am at a loss on how to fix it. I have googled and only found this (http://drupal.org/node/119621) would did not help.
sample code:
=========
<?php
function my_menu($may_cache) {
$items = array();
if ($may_cache) {
$items[] = array( 'path' => 'admin/content/my',
'title' => t('videos'),
'access' => user_access('edit own'),
'callback'=>'my_list');
$items[] = array( 'path' => 'admin/content/my/list',
'title' => t('list'),
'access' => user_access('edit own'),
'type' => MENU_DEFAULT_LOCAL_TASK);
$items[] = array( 'path' => 'admin/content/my/add',
'title' => t('add'),
'access' => user_access('edit own'),
'callback'=>'my_add',
'type' => MENU_LOCAL_TASK);
}
return $items;
}
function my_add($id=-1) {
$my=array();
if ($id!=-1){
$my = get_my($id);
}
$form['my']['file_name'] = array(
'#type' => 'file',
'#title' => t('File'),