From b0af4490479b4090c51a9201017b31a4929fe9c5 Mon Sep 17 00:00:00 2001 From: webchick Date: Mon, 4 Jul 2011 10:16:28 -0700 Subject: Issue #360377 by deviantintegral, janusman: Fixed book_get_books() cache becomes stale when batch-inserting book pages. --- modules/book/book.module | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules') diff --git a/modules/book/book.module b/modules/book/book.module index de9561fec..beb17214c 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -617,6 +617,8 @@ function _book_update_outline($node) { 'bid' => $node->book['bid'], )) ->execute(); + // Reset the cache of stored books. + drupal_static_reset('book_get_books'); } else { if ($node->book['bid'] != db_query("SELECT bid FROM {book} WHERE nid = :nid", array( @@ -624,6 +626,8 @@ function _book_update_outline($node) { ))->fetchField()) { // Update the bid for this page and all children. book_update_bid($node->book); + // Reset the cache of stored books. + drupal_static_reset('book_get_books'); } } @@ -895,6 +899,7 @@ function book_node_delete($node) { db_delete('book') ->condition('mlid', $node->book['mlid']) ->execute(); + drupal_static_reset('book_get_books'); } } -- cgit v1.2.3