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

- Fixed bug in SQL query in one of the sanity checks of book.module.
parent 4c50ea27
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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 {
......
......@@ -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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment