summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-09-29 14:15:44 +0000
committerDries Buytaert <dries@buytaert.net>2004-09-29 14:15:44 +0000
commit014bbd32ee97f514fe7e953faff28108ce72ac6f (patch)
treef0059e99da7b7b77ac3ada18353b698fb715ba4e /modules
parentf4b076bc016282201df6ca50c65e628bc03f9227 (diff)
downloadbrdo-014bbd32ee97f514fe7e953faff28108ce72ac6f.tar.gz
brdo-014bbd32ee97f514fe7e953faff28108ce72ac6f.tar.bz2
- Fixed SQL query in book module. Patch by killes.
Diffstat (limited to 'modules')
-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 0268329df..a9ce5c758 100644
--- a/modules/book.module
+++ b/modules/book.module
@@ -121,7 +121,7 @@ function book_block($op = 'list', $delta = 0) {
else {
// Only display this block when the user is browsing a book:
if (arg(0) == 'node' && is_numeric(arg(1))) {
- $result = db_query('SELECT n.nid, n.title, b.parent FROM {node} n '. node_access_join_sql() .' INNER JOIN {book} b ON n.nid = b.nid WHERE '. node_access_where_sql() .' n.nid = %d', arg(1));
+ $result = db_query('SELECT n.nid, n.title, b.parent FROM {node} n '. node_access_join_sql() .' INNER JOIN {book} b ON n.nid = b.nid WHERE '. node_access_where_sql() .' AND n.nid = %d', arg(1));
if (db_num_rows($result) > 0) {
$node = db_fetch_object($result);
diff --git a/modules/book/book.module b/modules/book/book.module
index 0268329df..a9ce5c758 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -121,7 +121,7 @@ function book_block($op = 'list', $delta = 0) {
else {
// Only display this block when the user is browsing a book:
if (arg(0) == 'node' && is_numeric(arg(1))) {
- $result = db_query('SELECT n.nid, n.title, b.parent FROM {node} n '. node_access_join_sql() .' INNER JOIN {book} b ON n.nid = b.nid WHERE '. node_access_where_sql() .' n.nid = %d', arg(1));
+ $result = db_query('SELECT n.nid, n.title, b.parent FROM {node} n '. node_access_join_sql() .' INNER JOIN {book} b ON n.nid = b.nid WHERE '. node_access_where_sql() .' AND n.nid = %d', arg(1));
if (db_num_rows($result) > 0) {
$node = db_fetch_object($result);