Skip to content
Snippets Groups Projects
Commit 0fc931c9 authored by Earl Miles's avatar Earl Miles
Browse files

#416298: Provide a mechanism so modules such as Hierarchical Select can...

#416298: Provide a mechanism so modules such as Hierarchical Select can cooperate with delegator form overriding.
parent e8cb14b5
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment