# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
Index: modules/book/book.module
--- modules/book/book.module Base (1.454.2.6)
+++ modules/book/book.module Locally Modified (Based On 1.454.2.6)
@@ -252,11 +252,14 @@
  *
  * This list may be used for generating a list of all the books, or for building
  * the options for a form select.
+ *
+ * @param $reset
+ *   Reset the cache of stored books.
  */
-function book_get_books() {
+function book_get_books($reset = FALSE) {
   static $all_books;
 
-  if (!isset($all_books)) {
+  if ($reset || !isset($all_books)) {
     $all_books = array();
     $result = db_query("SELECT DISTINCT(bid) FROM {book}");
     $nids = array();
@@ -464,12 +467,16 @@
     if ($new) {
       // Insert new.
       db_query("INSERT INTO {book} (nid, mlid, bid) VALUES (%d, %d, %d)", $node->nid, $node->book['mlid'], $node->book['bid']);
+      // Reset the cache of stored books.
+      book_get_books(TRUE);
     }
     else {
       if ($node->book['bid'] != db_result(db_query("SELECT bid FROM {book} WHERE nid = %d", $node->nid))) {
         // Update the bid for this page and all children.
         book_update_bid($node->book);
       }
+      // Reset the cache of stored books.
+      book_get_books(TRUE);
     }
     return TRUE;
   }
@@ -713,6 +720,8 @@
         }
         menu_link_delete($node->book['mlid']);
         db_query('DELETE FROM {book} WHERE mlid = %d', $node->book['mlid']);
+        // Reset the cache of stored books.
+        book_get_books(TRUE);
       }
       break;
     case 'prepare':
