summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2006-06-05 08:57:29 +0000
committerDries Buytaert <dries@buytaert.net>2006-06-05 08:57:29 +0000
commitcd85ca192ba55690cd39d20543ffa762e9c81b89 (patch)
tree9e2363bd47c08ef9196b525b4d817bd93fc3dd20
parent62954fce1c45826b6b48b48dcbaa699eb8ceba53 (diff)
downloadbrdo-cd85ca192ba55690cd39d20543ffa762e9c81b89.tar.gz
brdo-cd85ca192ba55690cd39d20543ffa762e9c81b89.tar.bz2
- Patch #66991 by dww and killes: infinite recursion in book_location_down() when there are multiple revisions.
-rw-r--r--modules/book.module2
-rw-r--r--modules/book/book.module2
2 files changed, 2 insertions, 2 deletions
diff --git a/modules/book.module b/modules/book.module
index 27b07dd4b..04b76f882 100644
--- a/modules/book.module
+++ b/modules/book.module
@@ -386,7 +386,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 n.status = 1 AND 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.vid = b.vid WHERE n.status = 1 AND b.parent = %d ORDER BY b.weight DESC, n.title DESC'), $node->nid));
if ($last_direct_child) {
$nodes[] = $last_direct_child;
$nodes = book_location_down($last_direct_child, $nodes);
diff --git a/modules/book/book.module b/modules/book/book.module
index 27b07dd4b..04b76f882 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -386,7 +386,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 n.status = 1 AND 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.vid = b.vid WHERE n.status = 1 AND b.parent = %d ORDER BY b.weight DESC, n.title DESC'), $node->nid));
if ($last_direct_child) {
$nodes[] = $last_direct_child;
$nodes = book_location_down($last_direct_child, $nodes);