wiki page won't be saved (and versioned) if no change is made to text
git-svn-id: http://redmine.rubyforge.org/svn/branches/work@318 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
1 parent
19dabda953
commit
02ff5764d5
1 file changed
+6
@@ -45,8 +45,14 @@ class WikiController < ApplicationController
|
|||||||
@page.content = WikiContent.new(:page => @page) if @page.new_record?
|
@page.content = WikiContent.new(:page => @page) if @page.new_record?
|
||||||
@content = @page.content
|
@content = @page.content
|
||||||
@content.text = "h1. #{@page.pretty_title}" if @content.text.empty?
|
@content.text = "h1. #{@page.pretty_title}" if @content.text.empty?
|
||||||
|
# don't keep previous comment
|
||||||
@content.comment = nil
|
@content.comment = nil
|
||||||
if request.post?
|
if request.post?
|
||||||
|
if @content.text == params[:content][:text]
|
||||||
|
# don't save if text wasn't changed
|
||||||
|
redirect_to :action => 'index', :id => @project, :page => @page.title
|
||||||
|
return
|
||||||
|
end
|
||||||
@content.text = params[:content][:text]
|
@content.text = params[:content][:text]
|
||||||
@content.comment = params[:content][:comment]
|
@content.comment = params[:content][:comment]
|
||||||
@content.author = logged_in_user
|
@content.author = logged_in_user
|
||||||
|
|||||||
Reference in new issue
Block a user