I am loading user form with this code
$account = user_load($user->uid);
module_load_include('inc', 'user', 'user.pages');
$userform = drupal_get_form('user_profile_form', $account);
return drupal_render($userform);
I have a image field in the form and i'm altering form to append another template file
function customuserprofile_form_alter(&$form, &$form_state, $form_id, $account = 'account') {
switch ($form_id) {
case 'user_profile_form':
$form['#theme'] = 'custom_profile_form';
and i am printing this field in custom-profile-form.tpl.php
<div class="field1"><?php print drupal_render($form['field_profile3']) ?> </div>
it is ok that code is showing me image field but when i click upload or remove button in image field i get this error
Notice: Undefined index: user_profile_form in drupal_retrieve_form() (line 760 of Z:\home\drupaler.uz\www\includes\form.inc).
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'user_profile_form' not found or invalid function name in drupal_retrieve_form() (line 795 of Z:\home\drupaler.uz\www\includes\form.inc).
Notice: Undefined index: #user_category in block_form_user_profile_form_alter() (line 563 of Z:\home\drupaler.uz\www\modules\block\block.module).
Notice: Undefined index: #user in ckeditor_user_customize() (line 41 of Z:\home\drupaler.uz\www\sites\all\modules\ckeditor\includes\ckeditor.user.inc).
Notice: Trying to get property of non-object in ckeditor_user_customize() (line 41 of Z:\home\drupaler.uz\www\sites\all\modules\ckeditor\includes\ckeditor.user.inc).
Notice: Undefined index: #user_category in system_form_user_profile_form_alter() (line 1954 of Z:\home\drupaler.uz\www\modules\system\system.module).
Notice: Undefined index: field_profile in file_ajax_upload() (line 271 of Z:\home\drupaler.uz\www\modules\file\file.module).
Notice: Undefined index: #suffix in file_ajax_upload() (line 280 of Z:\home\drupaler.uz\www\modules\file\file.module).
problem is that image field works uncorrectly with in my page. but it is ok in /user/1/edit page Maybe ajax in uploading, removing image needs some corrections or any hacks? Please help me I'm in trouble!