From 45ec917bc5ee8755aba67ce3158340d1d1fbcc7f Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Sat, 29 Dec 2012 21:09:06 +0100 Subject: [PATCH] Only rewrite pages that are not currently edited Pages that are currently edited will be rewritten after they were saved. --- action.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/action.php b/action.php index 31169ed..4786ff6 100644 --- a/action.php +++ b/action.php @@ -22,6 +22,7 @@ public function register($controller) { * @param mixed $param Optional parameters (not used) */ function handle_read(Doku_Event $event, $param) { + global $ACT; static $stack = array(); // handle only reads of the current revision if ($event->data[3]) return; @@ -29,6 +30,11 @@ function handle_read(Doku_Event $event, $param) { $id = $event->data[2]; if ($event->data[1]) $id = $event->data[1].':'.$id; if (isset($stack[$id])) return; + + // Don't change the page when the user is currently changing the page content or the page is locked by another user + if ((isset($ACT) && (in_array($ACT, array('save', 'preview', 'recover', 'revert')))) + || checklock($id) !== false) return; + $meta = p_get_metadata($id, 'plugin_pagemove', METADATA_DONT_RENDER); if ($meta && isset($meta['moves'])) { $stack[$id] = true;