To show add node form in particular place I created a new block on the Block page with content:
<?php
global $user;
module_load_include('inc', 'node', 'node.pages');
$node = (object) array('uid' => $user->uid, 'name' => (isset($user->name) ? $user->name : ''), 'type' => 'foto', 'language' => LANGUAGE_NONE);
$form = drupal_get_form('foto_node_form',$node);
print drupal_render($form);
?>
Then I go to my page with this block and try to add content within this block. When I fill only text fields or checkboxes everything is OK. But I receive a lot of errors when try to upload an image to image field.
•Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'node_form' was given in function drupal_retrieve_form() (line 800 in file D:\sites\mytheme\www\includes\form.inc).
•Notice: Undefined index: #node in function comment_form_node_form_alter() (line 1194 in fileD:\sites\mytheme\www\modules\comment\comment.module).
•Notice: Trying to get property of non-object in function comment_form_node_form_alter() (line 1211 in fileD:\sites\mytheme\www\modules\comment\comment.module).
•Notice: Undefined index: #node in function menu_form_node_form_alter() (line 629 in file D:\sites\mytheme\www\modules\menu\menu.module).
•Notice: Trying to get property of non-object in function menu_form_node_form_alter() (line 629 in fileD:\sites\mytheme\www\modules\menu\menu.module).
•Notice: Undefined index: #node in function menu_form_node_form_alter() (line 630 in file D:\sites\mytheme\www\modules\menu\menu.module).
•Notice: Trying to get property of non-object in function menu_form_node_form_alter() (line 630 in fileD:\sites\mytheme\www\modules\menu\menu.module).
•Notice: Undefined index: field_image in function file_ajax_upload() (line 271 in file D:\sites\mytheme\www\modules\file\file.module).
•Notice: Undefined index: #suffix in function file_ajax_upload() (line 280 in file D:\sites\mytheme\www\modules\file\file.module).
What I'm doing wrong? Thanks in advance