I have a scenario where I would like to reload/re-render the ctools_custom_content_type_edit_form after closing another ctools modal. To do so, I've bound an ajax object to the .close element within the open modal that will fire an ajax callback to open the ctools_custom_content_type_edit_form again.
My ajax callback looks like this, where the parent form is an argument in the menu callback. In this particular scenario, that form id is ctools_custom_content_type_edit_form.
The form is rendered, but it seems to be missing fields: Administrative Title, Title, Body. Any help would be appreciated. Let me know if you need more information.
function mymodule_parent_modal_callback($js, $parent_form_id) {
// Convert parent form id
$parent_form_id = str_replace ('-', '_', $parent_form_id);
$path = '' . drupal_get_path('module', 'wysifield');
if ($js) {
ctools_include('modal');
ctools_include('ajax');
}
else {
// Someone navigated to the AJAX endpoint.
drupal_access_denied();
}
$form_state = array(
'ajax' => TRUE,
'title' => t('Parent Modal Form'),
);
$commands = ctools_modal_form_wrapper($parent_form_id, $form_state);
// If form has been submitted, execute other ajax commands.
if (!empty($form_state['executed'])) {
// Add the responder javascript, required by ctools
ctools_add_js('ajax-responder');
// Create ajax command array, dismiss the modal window.
$commands = array();
$commands[] = ctools_modal_command_dismiss();
}
print ajax_render($commands);
drupal_exit();
}