I am adapting the joke module from the pro drupal development book. the joke
module uses the node module and hooks to do all the standard node
operations.
hook_info is used to define the joke node type.
hook_form is used for inputing the jokes nodes joke and punchlines.
a menu call back to /node/add/joke is used to allow you to call hook_form
and view the joke creation form.
i am tying to call the joke node creation form on its own so that it appears
as a local task on another node type. I have created the local task and when my local task when clicked it callsback my function my_joke_entry_page with has a call to drupal_get_form(joke_form).
But i get the error
warning: Missing argument 1 for question_form() in /home/lue/domains/londonukescorts.co.uk/www/public_html/sites/all/modules/question/question.module on line 115.
My problem is here, i do not have a node object to pass to the form, so what should i do ? and how should i pass it.
function joke_page() {
$output = t('my joke node creation form');
drupal_get_form(joke_form);
return $output;
}
function joke_form($node) {
// Get metadata for this node type
// (we use it for labeling title and body fields).
// We defined this in question_node_info().
$type = node_get_types('type', $node);
$form['title'] = array(
'#type' => 'textfield',