- Patch #66991 by dww and killes: infinite recursion in book_location_down() when there are multiple revisions.
parent
62954fce1c
commit
cd85ca192b
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue