By eugenechechel on
I have a hook_menu in my module
Artwork is a content type.
$items['galleryguide/artwork/new'] = array(
'title' => t('Add new Artwork'),
'page callback' => 'galleryguide_admin_artwork_new',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
'file' => 'galleryguide_admin.artwork.inc'
);
And I have hook_theme
function galleryguide_admin_theme($existing, $type, $theme, $path) {
return array(
'artwork_form' => array(
'template' => 'artwork_form',
'arguments' => array('form' => NULL),
'render element' => 'form',
),
);
}
In inc file I do next
function galleryguide_admin_artwork_new() {
return drupal_get_form('galleryguide_admin_artwork_form_new');
}
function galleryguide_admin_artwork_form_new() {
module_load_include('inc', 'node', 'node.pages');
$form = node_add('artwork');
$form['#theme'] = array('artwork_form');
return $form;
}
Then in my template called artwork_form.tpl.php I put
print drupal_render_children($form);
Everything renders fine, but I have an image upload file field and it does not work. It selects an image and then after I press upload it does not show any prevew and does not upload image
If I try to add node reference field I see system/ajax 500 error and nothing on frontend.
Same with all cck with widgets
Also file upload adds ajax-new-content span with empty inner html
Using same theme, and admin.
Can anyone tell me what can be the reason of that?