summaryrefslogtreecommitdiffstats
path: root/app/controllers/wiki_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-11-23 13:36:01 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-11-23 13:36:01 +0000
commite0a034164f3409336f686cfa381da8a5db15c40e (patch)
treee4bd9590116c03026375a3ae5c618e01cd7bddc3 /app/controllers/wiki_controller.rb
parent1ada789a6ccbbbaa55adc3a661ea7cef917d4b71 (diff)
downloadredmine-e0a034164f3409336f686cfa381da8a5db15c40e.tar.gz
redmine-e0a034164f3409336f686cfa381da8a5db15c40e.zip
Move wiki page to other project (#5450).
git-svn-id: http://svn.redmine.org/redmine/trunk@13643 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/wiki_controller.rb')
-rw-r--r--app/controllers/wiki_controller.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb
index 9b3981655..5ce55f2ce 100644
--- a/app/controllers/wiki_controller.rb
+++ b/app/controllers/wiki_controller.rb
@@ -198,9 +198,10 @@ class WikiController < ApplicationController
@page.redirect_existing_links = true
# used to display the *original* title if some AR validation errors occur
@original_title = @page.pretty_title
- if request.post? && @page.update_attributes(params[:wiki_page])
+ @page.safe_attributes = params[:wiki_page]
+ if request.post? && @page.save
flash[:notice] = l(:notice_successful_update)
- redirect_to project_wiki_page_path(@project, @page.title)
+ redirect_to project_wiki_page_path(@page.project, @page.title)
end
end
@@ -344,7 +345,11 @@ private
end
def redirect_to_page(page)
- redirect_to :action => action_name, :project_id => page.wiki.project, :id => page.title
+ if page.project && page.project.visible?
+ redirect_to :action => action_name, :project_id => page.project, :id => page.title
+ else
+ render_404
+ end
end
# Returns true if the current user is allowed to edit the page, otherwise false