From f1c3c49267011ac63193e875c8ce2863484a52c2 Mon Sep 17 00:00:00 2001
From: rjacobs <rjacobs@422459.no-reply.drupal.org>
Date: Mon, 24 Oct 2011 13:32:25 -0500
Subject: [PATCH] Issue #1282084: Fixes.

---
 revisioning.module  |    4 +++-
 revisioning_api.inc |    6 ++++++
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/revisioning.module b/revisioning.module
index 53683b6..8743733 100644
--- a/revisioning.module
+++ b/revisioning.module
@@ -517,7 +517,9 @@ function revisioning_node_presave($node) {
     // This is not required for correct operation, as a revision becomes
     // pending based on vid > current_revision_id. But it looks less confusing,
     // if the "Published" box is in sync with the moderation radio buttos.
-    $node->status = $auto_publish ? NODE_PUBLISHED : NODE_NOT_PUBLISHED;
+    if ($auto_publish) {
+      $node->status = NODE_PUBLISHED;
+    }
   }
 
   if (!isset($node->nid)) { // new node
diff --git a/revisioning_api.inc b/revisioning_api.inc
index 46ff64d..fd7bdee 100644
--- a/revisioning_api.inc
+++ b/revisioning_api.inc
@@ -423,6 +423,12 @@ function _revisioning_publish_revision(&$node_revision) {
     $node_revision->current_revision_id = $node_revision->vid;
     revisioning_update_taxonomy_index($node_revision);
   }
+  
+  // We also want to give various hooks a chance to be invoked upon making these
+  // changes (such as hook_node_access_records()), which can be done with a
+  // simple node_save on the actual node.
+  $node = node_load($node_revision->nid);
+  node_save($node);
 
   cache_clear_all(); // ? required ?
 
-- 
1.7.5.3

