diff --git a/plugins/contexts/node_add_form.inc b/plugins/contexts/node_add_form.inc index 529096e6d7c8fd18fd5654d1b6229844a8f05d69..63286d4bacfc4669884b6e0967f8430353119140 100644 --- a/plugins/contexts/node_add_form.inc +++ b/plugins/contexts/node_add_form.inc @@ -56,10 +56,16 @@ function ctools_context_create_node_add_form($empty, $data = NULL, $conf = FALSE $node = array('uid' => $user->uid, 'name' => $user->name, 'type' => $type); ctools_include('form'); - module_load_include('inc', 'node', 'node.pages'); $form_id = $node['type'] . '_node_form'; $form_state = array('want form' => TRUE, 'args' => array($node)); + + $file = drupal_get_path('module', 'node') . '/node.pages.inc'; + include_once './' . $file; + // This piece of information can let other modules know that more files + // need to be included if this form is loaded from cache: + $form_state['form_load_files'] = array($file); + $form = ctools_build_form($form_id, $form_state); // In a form, $data is the object being edited. $context->data = $type; diff --git a/plugins/contexts/node_edit_form.inc b/plugins/contexts/node_edit_form.inc index 91fbb3e6065cf3dea2c8618075a1498b5c13c319..df0e6339ab9d720905b3fa7c7f3bfcad1e19a6a8 100644 --- a/plugins/contexts/node_edit_form.inc +++ b/plugins/contexts/node_edit_form.inc @@ -45,11 +45,17 @@ function ctools_context_create_node_edit_form($empty, $node = NULL, $conf = FALS } if (!empty($node)) { - module_load_include('inc', 'node', 'node.pages'); ctools_include('form'); $form_id = $node->type . '_node_form'; $form_state = array('want form' => TRUE, 'args' => array($node)); + + $file = drupal_get_path('module', 'node') . '/node.pages.inc'; + include_once './' . $file; + // This piece of information can let other modules know that more files + // need to be included if this form is loaded from cache: + $form_state['form_load_files'] = array($file); + $form = ctools_build_form($form_id, $form_state); // Fill in the 'node' portion of the context