Set Default Value for Image Field contain Multiple Images I've added a multiple image field to the user account that uses the multiupload_imagefield_widget and it works when I edit the account.
On the other hand, I have a custom module with a form that I would like to edit just this field (I have a submit handler to update the user data). I call user_load to display the data and I can see the data is there in the debugger, but no images are displayed on the form.
What do I have to do to make them show up?
Here's my code:
$user_data = user_load($user-&gt;uid);
$form['my_imageGallery'] = array(
  '#type'             =&gt; 'image',
  '#title'            =&gt; t('Image Gallery'),
  '#default_value'    =&gt; isset($user_data-&gt;field_galeria) ? $user_data-&gt;field_galeria : null,
  '#upload_location'  =&gt; 'public://user_galleries/',
  '#upload_validators' =&gt; array('file_validate_extensions' =&gt; array('png jpg gif')),
);
I think you need to use a managed_file form element.
$user_data = user_load($user-&gt;uid);
$form['my_imageGallery'] = array(
  '#type'             =&gt; 'managed_file',
  '#title'            =&gt; t('Image Gallery'),
  '#default_value'    =&gt; isset($user_data-&gt;field_galeria) ? $user_data-&gt;field_galeria : null,
  '#upload_location'  =&gt; 'public://user_galleries/',
  '#upload_validators' =&gt; array('file_validate_extensions' =&gt; array('png jpg gif')),
);