I have created a ctools model to open node form having field collection. I am trying to save form, its show error.
function bayerkol_callback($ajax) {
if ($ajax) {
global $user;
ctools_include('ajax');
ctools_include('modal');
$form_state = array(
'ajax' => TRUE,
'title' => t('Add Event'),
);
$output = ctools_modal_form_wrapper('bayerkol_form', $form_state);
if (!empty($form_state['ajax_commands'])) {
$output = $form_state['ajax_commands'];
}
print ajax_render($output);
drupal_exit();
}
else {
return drupal_get_form('event_calendar_node_form');
}
}
function bayerkol_form($form, $form_state) {
$form = array();
ctools_form_include_file($form_state, drupal_get_path('module', 'node') . '/node.pages.inc');
$form = node_add('event_calendar');
return $form;
}
Please help me out.
Try my following code, hope this will works.
In above code no need to call bayerkol_form function. make sure your node form is correct example: for article use {article_node_form}