Ctools Custom Content Type Plugin with Image Field I was wondering if anyone has been successful with incorporating an Image field 'type'=&gt;'managed_file' into a ctools plugin.  I created a custom ctools plugin but am having some difficulty with the image field as I am getting an error upon upload.  After some searching, it seems like this error could be caused from a file that isn't being included when the form is rebuilt after the ajax request. I've attempted to use the form_load_include to include the DRUPAL_ROOT/modules/file/file.field.inc file, and it is being loaded with the form, but I am still receiving this error:

Notice: Undefined index: content_image_pane_edit_form in drupal_retrieve_form() (line 763 of /htdocs/development/includes/form.inc).
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'content_image_pane_edit_form' was given in drupal_retrieve_form() (line 798 of /htdocs/development/includes/form.inc).
Notice: Undefined index: pane_image in file_ajax_upload() (line 271 of /htdocs/development/modules/file/file.module).
Notice: Undefined index: #suffix in file_ajax_upload() (line 280 of /htdocs/development/modules/file/file.module).

Here is my settings for my Custom Content Type Ctools Plugin:
/*Plugin definition*/
$plugin = array(
  'single' =&gt; TRUE,
  'title' =&gt; t('Custom: Content Image Pane'),
  'description' =&gt; t('This is a custom pane containing a title, textarea and image field.'),
  'category' =&gt; t('Custom Panes'),
  'edit form' =&gt; 'content_image_pane_edit_form',
  'render callback' =&gt; 'content_image_pane_render',
  'admin info' =&gt; 'content_image_pane_admin_info',
  'defaults' =&gt; array(
    'pane_image' =&gt; '',
    'pane_content' =&gt; '',
  )
);
/**
 * 'Edit form' callback for the content type.
 */
function content_image_pane_edit_form($form, &amp;$form_state) {

  $form['#attributes']['enctype'] = array(&quot;multipart/form-data&quot;);

  form_load_include($form_state, 'inc', 'file', 'file.field');

  $conf = $form_state['conf'];

   $form['pane_image'] = array(
    '#title' =&gt; t('Image'),
    '#type' =&gt; 'managed_file',
    '#description' =&gt; t('Upload an Image that is associated with this content.'),
    '#default_value' =&gt; '',
    //'#default_value' =&gt; !empty($conf['pane_image']) ? variable_get($conf['pane_image']) : '',
    '#upload_location' =&gt; 'public://panes/',
    '#upload_validators' =&gt; array(
       'file_validate_extensions' =&gt; array('gif png jpeg jpg')
     ),
    '#array_parents' =&gt; array('pane_image')
  );

  $form['pane_content'] = array(
    '#title' =&gt; t('Content'),
    '#type' =&gt; 'text_format',
    '#format' =&gt; 'full_html',
    '#description' =&gt; t('Please enter the content for the custom pane here.'),
    '#default_value' =&gt; $conf['pane_content']['value'],
    '#cols' =&gt; 40,
    '#rows' =&gt; 6,
    '#resizable' =&gt; TRUE,
    '#required' =&gt; TRUE,
  );
  return $form;
}

If anyone could point me in the right direction for an answer to this that would be outstanding!
You should try to put this line:

form_load_include($form_state, 'inc', 'my_module','plugins/content_types/my_file');


at the top of your content_image_pane_edit_form function, replacing my_module and my_file with your module and plugin include file.

Ctools panes are generated in a separate modal from base Drupal forms and so when the AJAX reloads the form it cannot find the original form function. By forcing Drupal to include the full form code each time it is processed, the AJAX will be able to find the necessary function to rebuild the form.

Tested working with Drupal 7 &amp; panes on a production site.