--- outline_designer.module.orig 2008-05-15 10:52:09.000000000 -0400 +++ outline_designer.module 2008-05-15 10:56:07.000000000 -0400 @@ -366,7 +366,7 @@ function _outline_designer_ajax() { }else{ //figure out if there are currently any children //if there aren't then just give the child the parent's properties - $result = db_query("SELECT type FROM {node} JOIN {book} ON book.vid = node.vid WHERE parent=%d ORDER BY weight DESC",$parent); + $result = db_query("SELECT n.type FROM {node} as n JOIN {book} as b ON b.vid = n.vid WHERE b.parent=%d ORDER BY weight DESC",$parent); $num_rows = db_num_rows($result); if($num_rows == 0){ $parent_node = node_load($parent); @@ -447,7 +447,7 @@ function _outline_designer_ajax() { $root = $var1; $tree = array(); //pull the whole node tree but only get the nid's - $value = db_fetch_array(db_query("SELECT node.nid FROM {book} JOIN {node} ON node.vid=book.vid WHERE node.nid=%d",$root)); + $value = db_fetch_array(db_query("SELECT n.nid FROM {book} as b JOIN {node} as n ON n.vid=b.vid WHERE n.nid=%d",$root)); $tree[$value['nid']] = 0; $tree = _outline_designer_recurse_duplicate_nodes($root,$tree); //load each node in the node tree @@ -494,7 +494,7 @@ function _outline_designer_ajax() { //out: all the node roots case 'get_book_roots': $roots = array(); - $result = db_query("SELECT node.nid,title FROM {node} JOIN {book} ON book.vid = node.vid WHERE parent=0 ORDER BY node.nid"); + $result = db_query("SELECT n.nid,n.title FROM {node} as n JOIN {book} as b ON b.vid = n.vid WHERE parent=0 ORDER BY n.nid"); while($value = db_fetch_array($result)){ array_push($roots,array($value['nid'],$value['title'])); } @@ -507,7 +507,7 @@ function _outline_designer_ajax() { $nid = $var1; //pull everything $tree = array(); - $value = db_fetch_array(db_query("SELECT node.uid,node.nid,parent,title,type FROM {book} JOIN {node} ON node.vid=book.vid WHERE node.nid=%d ORDER BY weight",$nid)); + $value = db_fetch_array(db_query("SELECT n.uid,n.nid,b.parent,n.title,n.type FROM {book} as b JOIN {node} as n ON n.vid=b.vid WHERE n.nid=%d ORDER BY weight",$nid)); if($value['type'] == 'book'){ $term = 'pages'; }else{