From 1c0507dbcac26fe9481dc8c8d31aa2a392910267 Mon Sep 17 00:00:00 2001
From: Eric Rasmussen <eric@unl.edu>
Date: Fri, 13 Apr 2012 19:46:25 +0000
Subject: [PATCH] [gh-314] Merging test into staging

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x/staging@1543 20a16fea-79d4-4915-8869-1ea9d5ebf173
---
 README-UNL.txt                                              | 6 +++++-
 .../workbench_moderation/workbench_moderation.module        | 6 ++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/README-UNL.txt b/README-UNL.txt
index 112d7802..1c7e55e9 100644
--- a/README-UNL.txt
+++ b/README-UNL.txt
@@ -78,7 +78,11 @@ Add Trigger Support Patch to Workbench Moderation
  *   from http://drupal.org/node/1079134
  * Don't upgrade WB Moderation without first applying this patch unless the new version supports Triggers
 
+Fix broken books in Workbench Moderation
+ * mode in workbench_moderation.module in workbench_moderation_node_presave()
+ * http://drupal.org/node/1505060
+
 ------------------------------------
 wysiwyg/editors/js/tinymce-3.js
  * Comment out the part that switches wrappers from table-based to div. We need the original TinyMCE code for the PDW toggle plugin to work
- 
+
diff --git a/sites/all/modules/workbench_moderation/workbench_moderation.module b/sites/all/modules/workbench_moderation/workbench_moderation.module
index 63fdbc38..3109acfb 100644
--- a/sites/all/modules/workbench_moderation/workbench_moderation.module
+++ b/sites/all/modules/workbench_moderation/workbench_moderation.module
@@ -596,6 +596,12 @@ function workbench_moderation_node_presave($node) {
       $node->status = 0;
     }
   }
+  /** UNL CHANGE START **/
+  if (isset($node->workbench_moderation['updating_live_revision']) && !empty($node->book['bid'])) {
+    // Book module forces new revision in book_node_presave() that needs to be cancelled.
+    $node->revision = 0;
+  }
+  /** UNL CHANGE END **/
 }
 
 /**
-- 
GitLab