First I am not sure is this a nodehierarchy or delegator problem.
Here is my situation. I have a D6.9 site where I also have enabled panels (6.x-3.0-alpha2), ctools (6.x-1.0-alpha2) and delegator (6.x-1.0-alpha2).
When adding new children to some parent (with 'create new child' link on Children tab) , children node is created but it is not added to parent. I have found out that delegator module will run building of children edit form twice - in first form building nodehierarchy will define $node->parent and then in second form building nodehierarchy will then define $form['old_parent'] and this create situation that new node has parent so nodehierarchy_insert_node will not create parent->child connection.
Double form creation is happening in ctools/delegator/plugins/tasks/node_edit.inc in delegator_node_edit function:
function delegator_node_edit($node) {
// Load my task plugin
$task = delegator_get_task('node_edit');
// Load the node into a context.
ctools_include('context');
ctools_include('context-task-handler');
$contexts = ctools_context_handler_get_task_contexts($task, '', array($node));
$output = ctools_context_handler_render($task, '', $contexts);
if ($output === FALSE) {
// Fall back!
module_load_include('inc', 'node', 'node.pages');
$output = drupal_get_form($node->type . '_node_form', $node);
}
return $output;
}First form building is happening on
$contexts = ctools_context_handler_get_task_contexts($task, '', array($node));
and then because ctools_context_handler_render is returning FALSE, node form will be build one more time with drupal_get_form call.
I am not sure what to do with this - my solution was to disable delegator module (actually i dont need it - it was enabled just so i can check what it actually brings to panels - nothing i need for now). After disabling delegator module everything is working fine for me. I just wanted to report this so if somebody else have same problem it will know why parent-child relation is not created.
Comments
Comment #1
ronan commentedSounds like I need to change my form code to be more tolerant of multiple callings. I'll take a look at this when I get some time. Thanks for the heads up.
Ronan
Comment #2
markhalliwellCopy & Pasted: This issue pertains to the 6.x-1.x branch which is now legacy and is over two years old. If this issue is not applicable anymore, please consider closing it. Otherwise, please update this issue appropriately. Will be closed in two weeks if no response.