Hello!

I am trying to alter he node_delete_confirm form. I just user drupal_get_form to get the form and but getting an error
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'node_delete_confirm' was given in D:\wamp\www\daldev\includes\form.inc on line 366

i have also tried in this way

$nid = arg(1);
$node = array("nid" => $nid);
drupal_get_form("node_delete_confirm", $node);

but still the same error

what and where i am doing wrong
i need help...

thanks

Comments

haroon373’s picture

Title: alter node_delete_confirm » Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback + drupal 6

help me out from this issue guys
its become critical for me ...

thanks

takim’s picture

hello,
This is one of the critical bug i faced in drupal 6.

The solution which quite ok i think so.

To use node_add() or drupal_get_form(any node type form) then u need to include

include_once(drupal_get_path('module', 'node') . '/node.pages.inc'); inside your function where you calling the node_add or drupal_get_form function

so that it could access the node_form function or node_form functions. to render the form.

Cheer!
Takim

dave reid’s picture

Status: Active » Fixed

Comment #2 is correct. You need to include the right file first. Note you should actually use module_load_include('inc', 'node', 'node.pages');.

haroon373’s picture

Thank you very much guys
It work like a charm

craigmc100’s picture

Hello

I'm getting the error below

warning: call_user_func_array(): First argumented is expected to be a valid callback, 'forms_node_form' was given in /var/www/intranet/includes/form.inc on line 372.

This doesn't allow me to edit any top level navigation fields made.

If anyone could help I'd be most grateful

Regards

CRM

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.