r18557@gaspard (orig r1821): jplang | 2008-09-13 20:45:56 +0200

Fixed: unable to revert to a previous wiki page version.


git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1850 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Nicolas Chuche
2008-09-14 15:36:23 +00:00
parent c6f927ffc3
commit baba12c09c

View 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