From 5aded3bde8dcddca673a32eb04dc5f391cc2a2d5 Mon Sep 17 00:00:00 2001
From: Pieter Frenssen <pieter@frenssen.be>
Date: Wed, 7 Mar 2012 17:40:24 +0100
Subject: [PATCH] Issue #1379088 by pfrenssen: Avoid access denied error when publishing a draft that changes the URL alias.

---
 workbench_moderation.module |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/workbench_moderation.module b/workbench_moderation.module
index 87fac94..ff0f6a4 100644
--- a/workbench_moderation.module
+++ b/workbench_moderation.module
@@ -1712,6 +1712,9 @@ function workbench_moderation_moderate_form_submit($form, $form_state) {
   if (!empty($form['#destination'])) {
     if ($form_state['values']['state'] == workbench_moderation_state_published()) {
       if ($uri = entity_uri('node', $form['node']['#value'])) {
+        // Disable lookup of the path alias, since the path alias might get
+        // changed by modules such as Pathauto.
+        $uri['options']['alias'] = TRUE;
         $form_state['redirect'] = array($uri['path'], $uri['options']);
       }
     }
-- 
1.7.4.1

