From: Jean-Philippe Lang Date: Sat, 13 Sep 2008 18:45:56 +0000 (+0000) Subject: Fixed: unable to revert to a previous wiki page version. X-Git-Tag: 0.8.0-RC1~241 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=570d7e494ee47799dc0727c1c29a71cfa918582a;p=redmine.git Fixed: unable to revert to a previous wiki page version. git-svn-id: http://redmine.rubyforge.org/svn/trunk@1821 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index 5c8158db8..114010dff 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -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