Commit c50d7bcb authored by drumm's avatar drumm

#71613 by keve, fixing some PHP notices in the book module.

parent d048681f
......@@ -361,7 +361,7 @@ function book_outline_submit($form_id, $form_values) {
*/
function book_location($node, $nodes = array()) {
$parent = 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.nid = %d'), $node->parent));
if ($parent->title) {
if (isset($parent->title)) {
$nodes = book_location($parent, $nodes);
$nodes[] = $parent;
}
......@@ -499,6 +499,7 @@ function book_nodeapi(&$node, $op, $teaser, $page) {
*/
function theme_book_navigation($node) {
$output = '';
$links = '';
if ($node->nid) {
$tree = book_tree($node->nid);
......@@ -575,8 +576,9 @@ function book_toc($exclude = 0) {
* This is a helper function for book_tree()
*/
function book_tree_recurse($nid, $depth, $children, $unfold = array()) {
$output = '';
if ($depth > 0) {
if ($children[$nid]) {
if (isset($children[$nid])) {
foreach ($children[$nid] as $foo => $node) {
if (in_array($node->nid, $unfold)) {
if ($tree = book_tree_recurse($node->nid, $depth - 1, $children, $unfold)) {
......@@ -612,7 +614,7 @@ function book_tree($parent = 0, $depth = 3, $unfold = array()) {
$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 AND n.moderate = 0 ORDER BY b.weight, n.title'));
while ($node = db_fetch_object($result)) {
$list = $children[$node->parent] ? $children[$node->parent] : array();
$list = isset($children[$node->parent]) ? $children[$node->parent] : array();
$list[] = $node;
$children[$node->parent] = $list;
}
......
......@@ -361,7 +361,7 @@ function book_outline_submit($form_id, $form_values) {
*/
function book_location($node, $nodes = array()) {
$parent = 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.nid = %d'), $node->parent));
if ($parent->title) {
if (isset($parent->title)) {
$nodes = book_location($parent, $nodes);
$nodes[] = $parent;
}
......@@ -499,6 +499,7 @@ function book_nodeapi(&$node, $op, $teaser, $page) {
*/
function theme_book_navigation($node) {
$output = '';
$links = '';
if ($node->nid) {
$tree = book_tree($node->nid);
......@@ -575,8 +576,9 @@ function book_toc($exclude = 0) {
* This is a helper function for book_tree()
*/
function book_tree_recurse($nid, $depth, $children, $unfold = array()) {
$output = '';
if ($depth > 0) {
if ($children[$nid]) {
if (isset($children[$nid])) {
foreach ($children[$nid] as $foo => $node) {
if (in_array($node->nid, $unfold)) {
if ($tree = book_tree_recurse($node->nid, $depth - 1, $children, $unfold)) {
......@@ -612,7 +614,7 @@ function book_tree($parent = 0, $depth = 3, $unfold = array()) {
$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 AND n.moderate = 0 ORDER BY b.weight, n.title'));
while ($node = db_fetch_object($result)) {
$list = $children[$node->parent] ? $children[$node->parent] : array();
$list = isset($children[$node->parent]) ? $children[$node->parent] : array();
$list[] = $node;
$children[$node->parent] = $list;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment