diff options
author | Dries Buytaert <dries@buytaert.net> | 2001-06-24 14:02:49 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2001-06-24 14:02:49 +0000 |
commit | d0496d2e7c32aac5a5fa08dfa67cb5764fc365df (patch) | |
tree | d416ede6f248457e781bc5888010cf68fd5612db | |
parent | 4c50ea277662e08e266c806dffc3995a74b97ba6 (diff) | |
download | brdo-d0496d2e7c32aac5a5fa08dfa67cb5764fc365df.tar.gz brdo-d0496d2e7c32aac5a5fa08dfa67cb5764fc365df.tar.bz2 |
- Fixed bug in SQL query in one of the sanity checks of book.module.
-rw-r--r-- | modules/book.module | 2 | ||||
-rw-r--r-- | modules/book/book.module | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/modules/book.module b/modules/book.module index 6e994c4a9..1ec711153 100644 --- a/modules/book.module +++ b/modules/book.module @@ -245,7 +245,7 @@ function book_edit($id) { if ($node->status != $status[posted]) { return t("You can only update accepted pages: pages that are still queued or already expired can not be updated."); } - else if (db_result(db_query("SELECT COUNT(nid) FROM node WHERE pid = '$node->nid' AND status = '$status[queued]'"))) { + else if (db_result(db_query("SELECT COUNT(n.nid) FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE b.pid = '$node->nid' AND n.status = '$status[queued]'"))) { return t("There is already an update for this node in the queue: we can only process one update at once."); } else { diff --git a/modules/book/book.module b/modules/book/book.module index 6e994c4a9..1ec711153 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -245,7 +245,7 @@ function book_edit($id) { if ($node->status != $status[posted]) { return t("You can only update accepted pages: pages that are still queued or already expired can not be updated."); } - else if (db_result(db_query("SELECT COUNT(nid) FROM node WHERE pid = '$node->nid' AND status = '$status[queued]'"))) { + else if (db_result(db_query("SELECT COUNT(n.nid) FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE b.pid = '$node->nid' AND n.status = '$status[queued]'"))) { return t("There is already an update for this node in the queue: we can only process one update at once."); } else { |