summaryrefslogtreecommitdiff
path: root/modules/book/book.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/book/book.module')
-rw-r--r--modules/book/book.module1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/book/book.module b/modules/book/book.module
index 584c78b5b..979dbf613 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -553,6 +553,7 @@ function book_toc_recurse($nid, $indent, $toc, $children, $exclude) {
function book_toc($exclude = 0) {
$result = db_query(db_rewrite_sql('SELECT n.nid, n.title, b.parent, b.weight FROM {node} n INNER JOIN {book} b ON n.vid = b.vid WHERE n.status = 1 ORDER BY b.weight, n.title'));
+ $children = array();
while ($node = db_fetch_object($result)) {
if (!$children[$node->parent]) {
$children[$node->parent] = array();