]> source.dussan.org Git - redmine.git/commitdiff
Fixed: unable to revert to a previous wiki page version.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 13 Sep 2008 18:45:56 +0000 (18:45 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 13 Sep 2008 18:45:56 +0000 (18:45 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1821 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/wiki_controller.rb

index 5c8158db813f44b009bb2599ce1a167571e9c9d6..114010dff37bf3346daf4e909e34a67662f0048b 100644 (file)
@@ -66,7 +66,10 @@ class WikiController < ApplicationController
     @content.text = "h1. #{@page.pretty_title}" if @content.text.blank?
     # don't keep previous comment
     @content.comments = nil
-    if request.post?      
+    if request.get?
+      # To prevent StaleObjectError exception when reverting to a previous version
+      @content.version = @page.content.version
+    else
       if !@page.new_record? && @content.text == params[:content][:text]
         # don't save if text wasn't changed
         redirect_to :action => 'index', :id => @project, :page => @page.title