drupal localhost

drupal-4.7.4

Cant get a drupal_get_form to work with _menu hook callback function

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'),

Drupal 4.7.8 and 5.3 released: Security updates and bugfixes.

Drupal 4.7.8 and 5.3 are now available for download. These are maintenance releases that fix problems reported using the bug tracking system, as well as some security vulnerabilities.

Upgrading your existing Drupal sites is strongly recommended.

Download

SA-2007-030 - Drupal Core - API handling of unpublished comment.

  • Advisory ID: DRUPAL-SA-2007-030
  • Project: Drupal core
  • Version: 4.7.x, 5.x
  • Date: 2007-October-17
  • Security risk: Not critical
  • Exploitable from: Remote
  • Vulnerability: Access bypass

SA-2007-026 - Drupal Core - Cross site scripting via uploads

  • Advisory ID: DRUPAL-SA-2007-026
  • Project: Drupal core
  • Version: 4.7.x, 5.x
  • Date: 2007-October-17
  • Security risk: Moderately critical
  • Exploitable from: Remote
  • Vulnerability: Cross site scripting

SA-2007-024 - Drupal Core - HTTP response splitting

  • Advisory ID: DRUPAL-SA-2007-024
  • Project: Drupal core
  • Version: 4.7.x, 5.x
  • Date: 2007-October-17
  • Security risk: Moderately critical
  • Exploitable from: Remote
  • Vulnerability: HTTP response splitting

Pages

Subscribe with RSS Subscribe to RSS - Drupal 4.7.x