summaryrefslogtreecommitdiffstats
path: root/app/controllers/wiki_controller.rb
diff options
context:
space:
mode:
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 fb472636b..e0e159a00 100644
--- a/app/controllers/wiki_controller.rb
+++ b/app/controllers/wiki_controller.rb
@@ -76,7 +76,8 @@ class WikiController < ApplicationController
@content.version = @page.content.version
else
if !@page.new_record? && @content.text == params[:content][:text]
- attach_files(@page, params[:attachments])
+ attachments = Attachment.attach_files(@page, params[:attachments])
+ flash[:warning] = attachments[:flash] if attachments[:flash]
# don't save if text wasn't changed
redirect_to :action => 'index', :id => @project, :page => @page.title
return
@@ -87,7 +88,8 @@ class WikiController < ApplicationController
@content.author = User.current
# if page is new @page.save will also save content, but not if page isn't a new record
if (@page.new_record? ? @page.save : @content.save)
- attach_files(@page, params[:attachments])
+ attachments = Attachment.attach_files(@page, params[:attachments])
+ flash[:warning] = attachments[:flash] if attachments[:flash]
call_hook(:controller_wiki_edit_after_save, { :params => params, :page => @page})
redirect_to :action => 'index', :id => @project, :page => @page.title
end
@@ -211,7 +213,8 @@ class WikiController < ApplicationController
def add_attachment
return render_403 unless editable?
- attach_files(@page, params[:attachments])
+ attachments = Attachment.attach_files(@page, params[:attachments])
+ flash[:warning] = attachments[:flash] if attachments[:flash]
redirect_to :action => 'index', :page => @page.title
end