summaryrefslogtreecommitdiffstats
path: root/app/controllers/wiki_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-11-18 16:41:54 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-11-18 16:41:54 +0000
commit1e8a9da131686eb327d3ee3e31f5b3ac6b1b68bf (patch)
treee9f71339d76b0ab9c9badfa8a1e5c38fcf5bc6b6 /app/controllers/wiki_controller.rb
parent2770e285358a8ae1e39cc7f594e1ccf8cfa417c3 (diff)
downloadredmine-1e8a9da131686eb327d3ee3e31f5b3ac6b1b68bf.tar.gz
redmine-1e8a9da131686eb327d3ee3e31f5b3ac6b1b68bf.zip
Handle the case of a text formatter that doesn't support section edit (#2222).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7831 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/wiki_controller.rb')
-rw-r--r--app/controllers/wiki_controller.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb
index ba37a511f..b247867d1 100644
--- a/app/controllers/wiki_controller.rb
+++ b/app/controllers/wiki_controller.rb
@@ -85,7 +85,10 @@ class WikiController < ApplicationController
end
end
@editable = editable?
- @sections_editable = @editable && User.current.allowed_to?(:edit_wiki_pages, @page.project) && params[:version].nil?
+ @sections_editable = @editable && User.current.allowed_to?(:edit_wiki_pages, @page.project) &&
+ params[:version].nil? &&
+ Redmine::WikiFormatting.supports_section_edit?
+
render :action => 'show'
end
@@ -103,7 +106,7 @@ class WikiController < ApplicationController
@content.version = @page.content.version
@text = @content.text
- if params[:section].present?
+ if params[:section].present? && Redmine::WikiFormatting.supports_section_edit?
@section = params[:section].to_i
@text, @section_hash = Redmine::WikiFormatting.formatter.new(@text).get_section(@section)
render_404 if @text.blank?
@@ -131,7 +134,7 @@ class WikiController < ApplicationController
@content.comments = params[:content][:comments]
@text = params[:content][:text]
- if params[:section].present?
+ if params[:section].present? && Redmine::WikiFormatting.supports_section_edit?
@section = params[:section].to_i
@section_hash = params[:section_hash]
@content.text = Redmine::WikiFormatting.formatter.new(@content.text).update_section(params[:section].to_i, @text, @section_hash)