From d9e72f37de62ae2c96925ec5f75c7e6bd449b59b Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 31 Mar 2001 13:18:57 +0000 Subject: - fixed update bug --- modules/book.module | 2 +- modules/book/book.module | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/book.module b/modules/book.module index 40baa5246..8009ae27e 100644 --- a/modules/book.module +++ b/modules/book.module @@ -18,7 +18,7 @@ class Book { } function book_navigation($node) { - if ($node->nid) { + if ($node->nid && $node->parent && $node->weight) { $next = db_fetch_object(db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE b.parent = '$node->parent' AND b.weight > $node->weight ORDER BY b.weight ASC")); $prev = db_fetch_object(db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE b.parent = '$node->parent' AND b.weight < $node->weight ORDER BY b.weight DESC")); } diff --git a/modules/book/book.module b/modules/book/book.module index 40baa5246..8009ae27e 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -18,7 +18,7 @@ class Book { } function book_navigation($node) { - if ($node->nid) { + if ($node->nid && $node->parent && $node->weight) { $next = db_fetch_object(db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE b.parent = '$node->parent' AND b.weight > $node->weight ORDER BY b.weight ASC")); $prev = db_fetch_object(db_query("SELECT n.nid, n.title FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE b.parent = '$node->parent' AND b.weight < $node->weight ORDER BY b.weight DESC")); } -- cgit v1.2.3