-6

I have the same problem described in I get image field upload errors with a custom node_add() form.

How do I add these lines to the menu item array?

'file path' => drupal_get_path('module', 'node'),
'file' => 'node.pages.inc',

I get the following errors:

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'node_form' not found or invalid function name in drupal_retrieve_form() (line 800 of C:\xampp\htdocs\semt1\includes\form.inc).
Notice: Undefined index: #node in comment_form_node_form_alter() (line 1194 of C:\xampp\htdocs\semt1\modules\comment\comment.module).
Notice: Trying to get property of non-object in comment_form_node_form_alter() (line 1211 of C:\xampp\htdocs\semt1\modules\comment\comment.module).
Notice: Undefined index: #node in location_node_form_node_form_alter() (line 14 of C:\xampp\htdocs\semt1\sites\all\modules\location\location_node.module).
Notice: Trying to get property of non-object in location_node_form_node_form_alter() (line 15 of C:\xampp\htdocs\semt1\sites\all\modules\location\location_node.module).
Notice: Undefined index: #node in menu_form_node_form_alter() (line 629 of C:\xampp\htdocs\semt1\modules\menu\menu.module).
Notice: Trying to get property of non-object in menu_form_node_form_alter() (line 629 of C:\xampp\htdocs\semt1\modules\menu\menu.module).
Notice: Undefined index: #node in menu_form_node_form_alter() (line 630 of C:\xampp\htdocs\semt1\modules\menu\menu.module).
Notice: Trying to get property of non-object in menu_form_node_form_alter() (line 630 of C:\xampp\htdocs\semt1\modules\menu\menu.module).
Notice: Undefined index: #node in translation_form_node_form_alter() (line 135 of C:\xampp\htdocs\semt1\modules\translation\translation.module).
Notice: Trying to get property of non-object in translation_form_node_form_alter() (line 135 of C:\xampp\htdocs\semt1\modules\translation\translation.module).
Notice: Undefined index: field_im in file_ajax_upload() (line 271 of C:\xampp\htdocs\semt1\modules\file\file.module).
Notice: Undefined index: #suffix in file_ajax_upload() (line 280 of C:\xampp\htdocs\semt1\modules\file\file.module).

I am using this module.

1
  • This seems like a very localized issue concerning a non-Drupal hosted module. You would probably be better off asking whoever wrote the original code.
    – Chapabu
    Oct 21, 2012 at 19:12

1 Answer 1

1

Try this:

function yourmodule_menu_alter(&$items) {
  $items['system/ajax']['file path'] = drupal_get_path('module', 'node');
  $items['system/ajax']['file'] = 'node.pages.inc';
}
10
  • I try this function bus still same error when upload file Oct 21, 2012 at 17:43
  • if you have another solution tell me about Oct 21, 2012 at 17:56
  • did you flushed all chaches? Oct 21, 2012 at 19:24
  • yes I clear all cache Oct 21, 2012 at 19:49
  • Have you replaced yourmodule in the function's name with your actual module name? Oct 22, 2012 at 8:55

Not the answer you're looking for? Browse other questions tagged or ask your own question.