Index: menu.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/menu.inc,v retrieving revision 1.255.2.34 diff -u -r1.255.2.34 menu.inc --- menu.inc 1 Feb 2010 18:00:49 -0000 1.255.2.34 +++ menu.inc 1 Jun 2010 21:19:11 -0000 @@ -999,12 +999,13 @@ * menu_tree_collect_node_links(). */ function menu_tree_check_access(&$tree, $node_links = array()) { + $status = user_access('administer nodes') ? '' : 'n.status = 1 AND'; if ($node_links) { // Use db_rewrite_sql to evaluate view access without loading each full node. $nids = array_keys($node_links); $placeholders = '%d'. str_repeat(', %d', count($nids) - 1); - $result = db_query(db_rewrite_sql("SELECT n.nid FROM {node} n WHERE n.status = 1 AND n.nid IN (". $placeholders .")"), $nids); + $result = db_query(db_rewrite_sql("SELECT n.nid FROM {node} n WHERE ". $status ." n.nid IN (". $placeholders .")"), $nids); while ($node = db_fetch_array($result)) { $nid = $node['nid']; foreach ($node_links[$nid] as $mlid => $link) { Index: book.module =================================================================== RCS file: /cvs/drupal/drupal/modules/book/book.module,v retrieving revision 1.454.2.6 diff -u -r1.454.2.6 book.module --- book.module 25 Feb 2009 11:47:37 -0000 1.454.2.6 +++ book.module 1 Jun 2010 21:15:12 -0000 @@ -52,7 +52,7 @@ if ($type == 'node' && isset($node->book)) { if (!$teaser) { $child_type = variable_get('book_child_type', 'book'); - if ((user_access('add content to books') || user_access('administer book outlines')) && node_access('create', $child_type) && $node->status == 1 && $node->book['depth'] < MENU_MAX_DEPTH) { + if ((user_access('add content to books') || user_access('administer book outlines')) && node_access('create', $child_type) && $node->book['depth'] < MENU_MAX_DEPTH) { $links['book_add_child'] = array( 'title' => t('Add child page'), 'href' => "node/add/". str_replace('_', '-', $child_type), @@ -264,7 +264,8 @@ $nids[] = $book['bid']; } if ($nids) { - $result2 = db_query(db_rewrite_sql("SELECT n.type, n.title, b.*, ml.* FROM {book} b INNER JOIN {node} n on b.nid = n.nid INNER JOIN {menu_links} ml ON b.mlid = ml.mlid WHERE n.nid IN (". implode(',', $nids) .") AND n.status = 1 ORDER BY ml.weight, ml.link_title")); + $status = user_access('administer nodes') ? '' : 'AND n.status = 1'; + $result2 = db_query(db_rewrite_sql("SELECT n.type, n.title, b.*, ml.* FROM {book} b INNER JOIN {node} n on b.nid = n.nid INNER JOIN {menu_links} ml ON b.mlid = ml.mlid WHERE n.nid IN (". implode(',', $nids) .") ". $status ." ORDER BY ml.weight, ml.link_title")); while ($link = db_fetch_array($result2)) { $link['href'] = $link['link_path']; $link['options'] = unserialize($link['options']); @@ -407,7 +408,7 @@ // The node can become a new book, if it is not one already. $options = array($nid => '<'. t('create a new book') .'>') + $options; } - if (!$node->book['mlid']) { + if (!$node->book['mlid'] || (user_access('administer nodes'))) { // The node is not currently in a the hierarchy. $options = array(0 => '<'. t('none') .'>') + $options; }