Hey Guys,
I got a module error. Corrected it. There was a mistake while calling the function
Here is my code snippet:
INCORRECT VERSION
================
$items['tutumod/display'] = array(
'title' => 'display tutumod',
'description' => 'tutumodtutumodtutumodtutumodtutumodtutumodtutumodtutumod',
'page callback' => 'drupal_get_form',
'page arguments' => array('tutumod_nodeapi'),
'access arguments' => array('access content'),
'type' => MENU_NORMAL_ITEM,
);
CORRECTED VERSION
================
$items['tutumod/display'] = array(
'title' => 'display tutumod',
'description' => 'tutumodtutumodtutumodtutumodtutumodtutumodtutumodtutumod',
'page callback' => 'tutumod_nodeapi',
// 'page arguments' => array('tutumod_nodeapi'),
'access arguments' => array('access content'),
'type' => MENU_NORMAL_ITEM,
);
The problem was I already had an array element $items[...] that did this 'page callback' => 'drupal_get_form'.
So my question is:
Why did I get the error is it because I cant have 'page callback' => 'drupal_get_form' twice??? OR Is it cause if i have 'page callback' => 'drupal_get_form' I need to return an array that has the Form elements????
Comments
If page callback is drupal
If page callback is drupal _get_form you to define page arguments with at least one argument, the form id of the form you want to display (by default the form id is the function name that builds the form).
Your form id though appears to be tutumod_nodeapi which is a hook function and would cause problems.
ERROR
Fatal error: Cannot unset string offsets in C:\wamp\www\drupal\includes\form.inc on line 485 was the error that I got Originally.
Nope. Thts not the case I changed the call back to my name still the same msg.
What does your function look
What does your function look like? It would useful if you posted the function plus your modules hook_menu function. Please remember to place the code between <code> and </code> tags.
Here is the .module file.
Here is the .module file. Please have a look and comment.