summaryrefslogtreecommitdiff
path: root/modules/book.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-07-29 07:13:25 +0000
committerDries Buytaert <dries@buytaert.net>2005-07-29 07:13:25 +0000
commitf99176c9a06cc905c6ef71598ba052928b741678 (patch)
tree8383639d773584ef9055eff5f30724d4efc50a80 /modules/book.module
parent4103aada8885865f9e099bf1c33f7db58cad864e (diff)
downloadbrdo-f99176c9a06cc905c6ef71598ba052928b741678.tar.gz
brdo-f99176c9a06cc905c6ef71598ba052928b741678.tar.bz2
- Patch #25706 by Neil: book 'previous' link does not respect unpublished node setting
Diffstat (limited to 'modules/book.module')
-rw-r--r--modules/book.module2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/book.module b/modules/book.module
index bdc781903..447414308 100644
--- a/modules/book.module
+++ b/modules/book.module
@@ -342,7 +342,7 @@ function book_location($node, $nodes = array()) {
* Accumulates the nodes up to the root of the book from the given node in the $nodes array.
*/
function book_location_down($node, $nodes = array()) {
- $last_direct_child = db_fetch_object(db_query(db_rewrite_sql('SELECT n.nid, n.title, b.parent, b.weight FROM {node} n INNER JOIN {book} b ON n.nid = b.nid WHERE b.parent = %d ORDER BY b.weight DESC, n.title DESC'), $node->nid));
+ $last_direct_child = db_fetch_object(db_query(db_rewrite_sql('SELECT n.nid, n.title, b.parent, b.weight FROM {node} n INNER JOIN {book} b ON n.nid = b.nid WHERE n.status = 1 AND b.parent = %d ORDER BY b.weight DESC, n.title DESC'), $node->nid));
if ($last_direct_child) {
array_push($nodes, $last_direct_child);
$nodes = book_location_down($last_direct_child, $nodes);