Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e045f0b3b5 | ||
|
|
e64ba44fca |
@@ -1,6 +1,6 @@
|
|||||||
source 'http://rubygems.org'
|
source 'http://rubygems.org'
|
||||||
|
|
||||||
gem 'rails', '3.2.11'
|
gem 'rails', '3.2.8'
|
||||||
gem "jquery-rails", "~> 2.0.2"
|
gem "jquery-rails", "~> 2.0.2"
|
||||||
gem "i18n", "~> 0.6.0"
|
gem "i18n", "~> 0.6.0"
|
||||||
gem "coderay", "~> 1.0.6"
|
gem "coderay", "~> 1.0.6"
|
||||||
|
|||||||
@@ -129,6 +129,15 @@ class WikiController < ApplicationController
|
|||||||
# don't keep previous comment
|
# don't keep previous comment
|
||||||
@content.comments = nil
|
@content.comments = nil
|
||||||
|
|
||||||
|
if !@page.new_record? && params[:content].present? && @content.text == params[:content][:text]
|
||||||
|
attachments = Attachment.attach_files(@page, params[:attachments])
|
||||||
|
render_attachment_warning_if_needed(@page)
|
||||||
|
# don't save content if text wasn't changed
|
||||||
|
@page.save
|
||||||
|
redirect_to :action => 'show', :project_id => @project, :id => @page.title
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
@content.comments = params[:content][:comments]
|
@content.comments = params[:content][:comments]
|
||||||
@text = params[:content][:text]
|
@text = params[:content][:text]
|
||||||
if params[:section].present? && Redmine::WikiFormatting.supports_section_edit?
|
if params[:section].present? && Redmine::WikiFormatting.supports_section_edit?
|
||||||
@@ -140,8 +149,8 @@ class WikiController < ApplicationController
|
|||||||
@content.text = @text
|
@content.text = @text
|
||||||
end
|
end
|
||||||
@content.author = User.current
|
@content.author = User.current
|
||||||
|
@page.content = @content
|
||||||
if @page.save_with_content
|
if @page.save
|
||||||
attachments = Attachment.attach_files(@page, params[:attachments])
|
attachments = Attachment.attach_files(@page, params[:attachments])
|
||||||
render_attachment_warning_if_needed(@page)
|
render_attachment_warning_if_needed(@page)
|
||||||
call_hook(:controller_wiki_edit_after_save, { :params => params, :page => @page})
|
call_hook(:controller_wiki_edit_after_save, { :params => params, :page => @page})
|
||||||
|
|||||||
@@ -172,21 +172,6 @@ class WikiPage < ActiveRecord::Base
|
|||||||
self.parent = parent_page
|
self.parent = parent_page
|
||||||
end
|
end
|
||||||
|
|
||||||
# Saves the page and its content if text was changed
|
|
||||||
def save_with_content
|
|
||||||
ret = nil
|
|
||||||
transaction do
|
|
||||||
if new_record?
|
|
||||||
# Rails automatically saves associated content
|
|
||||||
ret = save
|
|
||||||
else
|
|
||||||
ret = save && (content.text_changed? ? content.save : true)
|
|
||||||
end
|
|
||||||
raise ActiveRecord::Rollback unless ret
|
|
||||||
end
|
|
||||||
ret
|
|
||||||
end
|
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def validate_parent_title
|
def validate_parent_title
|
||||||
|
|||||||
@@ -4,10 +4,6 @@ Redmine - project management software
|
|||||||
Copyright (C) 2006-2012 Jean-Philippe Lang
|
Copyright (C) 2006-2012 Jean-Philippe Lang
|
||||||
http://www.redmine.org/
|
http://www.redmine.org/
|
||||||
|
|
||||||
== 2013-01-09 v2.1.6
|
|
||||||
|
|
||||||
* Upgrade to Rails 3.2.11
|
|
||||||
|
|
||||||
== 2012-12-18 v2.1.5
|
== 2012-12-18 v2.1.5
|
||||||
|
|
||||||
* Defect #12400: Validation fails when receiving an email with list custom fields
|
* Defect #12400: Validation fails when receiving an email with list custom fields
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ module Redmine
|
|||||||
module VERSION #:nodoc:
|
module VERSION #:nodoc:
|
||||||
MAJOR = 2
|
MAJOR = 2
|
||||||
MINOR = 1
|
MINOR = 1
|
||||||
TINY = 6
|
TINY = 5
|
||||||
|
|
||||||
# Branch values:
|
# Branch values:
|
||||||
# * official release: nil
|
# * official release: nil
|
||||||
|
|||||||
Reference in New Issue
Block a user