Index: nodehierarchy.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/nodehierarchy/nodehierarchy.module,v
retrieving revision 1.4.2.14
diff -u -p -r1.4.2.14 nodehierarchy.module
--- nodehierarchy.module	15 Feb 2009 05:58:02 -0000	1.4.2.14
+++ nodehierarchy.module	17 Feb 2009 11:29:09 -0000
@@ -400,6 +400,13 @@ function nodehierarchy_nodehierarchyapi(
 function nodehierarchy_insert_node(&$node) {
   global $user;
 
+  // If we are not coming from node_form node->old_parent will not be set, 
+  // like for example for workflow state node form.
+  if (isset($node->nid) && !isset($node->old_parent)) {
+    $hieararchy = nodehierarchy_load_node($node);
+    $node->old_parent = $hieararchy['parent'];
+  }
+
   // If the node is valid and the parent has changed or the node does not already have a parent.
   if ($node->nid && (@$node->old_parent !== @$node->parent) || @$node->old_parent === NULL) {
 
