Skip to content
Snippets Groups Projects
Commit ac39ff30 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #25706 by Neil: book 'previous' link does not respect unpublished node setting

parent df69978f
No related branches found
No related tags found
No related merge requests found
......@@ -334,7 +334,7 @@ function book_location($node, $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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment