I've exposed a node\_add form and styled it for certain roles to use. The form is being displayed in panels, through an 'article' node type using the PHP text filter. Users can create new nodes with no issues, but there are errors displayed when users try to upload an image in the form:

> 
> 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 795 of /var/www/html/includes/form.inc).  
> 
>  Notice: Undefined index: #node in comment\_form\_node\_form\_alter() (line 1193 of /var/www/html/modules/comment/comment.module).  
> 
>  Notice: Trying to get property of non-object in comment\_form\_node\_form\_alter() (line 1210 of /var/www/html/modules/comment/comment.module).  
> 
>  Notice: Undefined index: #node in menu\_form\_node\_form\_alter() (line 629 of /var/www/html/modules/menu/menu.module).  
> 
>  Notice: Trying to get property of non-object in menu\_form\_node\_form\_alter() (line 629 of /var/www/html/modules/menu/menu.module).  
> 
>  Notice: Undefined index: #node in menu\_form\_node\_form\_alter() (line 630 of /var/www/html/modules/menu/menu.module).  
> 
>  Notice: Trying to get property of non-object in menu\_form\_node\_form\_alter() (line 630 of /var/www/html/modules/menu/menu.module).  
> 
>  Notice: Undefined index: field\_obs\_image in file\_ajax\_upload() (line 271 of /var/www/html/modules/file/file.module).  
> 
>  Notice: Undefined index: #suffix in file\_ajax\_upload() (line 280 of /var/www/html/modules/file/file.module). 
> 
> 
> 

The actual node form code looks like this:

```
module_load_include('inc', 'node', 'node.pages');
$form = node_add('observation');
print drupal_render($form);

```

I have also tried this code with the same results:

```
$node_type = 'observation';
$form_id = $node_type . '_node_form';
// maybe add current users info
global $user;
// create a blank node

$node = new stdClass(); 
$node->uid = $user->uid; 
$node->name = (isset($user->name) ? $user->name : ''); 
$node->type = $node_type; 
$node->language = ''; 
node_object_prepare($node); 
$output = drupal_render(drupal_get_form($form_id, $node));

print $output;

```

The content type being added is 'observation'. I am also using the identical technique on another page with a different content type, and it results in the exact same error. The error appears directly above the image field during the AJAX image upload call.

I have also done a debug\_backtrace() near line 795 of form.inc and can post the results if requested.

I have read all of these articles, to no avail:

* ["Notice: Undefined index: field\_xxx in file\_ajax\_upload()" and "Undefined index: #suffix in file\_ajax\_upload"](http://drupal.org/node/1336212)
* [D7 Image field upload errors with custom node\_add() form](http://drupal.org/node/1572928)
* [How to disable AJAX for a file field](http://drupal.org/node/1526300#comment-5859594)
* [The Field module shows an error when I call drupal\_get\_form()](https://drupal.stackexchange.com/questions/20084/d7-field-module-error-when-calls-drupal-get-form)
* [Can't use file field in custom form - gives AJAX errors](https://drupal.stackexchange.com/questions/18618/cant-use-file-field-in-custom-form-gives-ajax-errors)

Does anyone have an idea as to where I can start looking? This seems to be a tough problem. Thanks for your time!