summaryrefslogtreecommitdiffstats
path: root/app/controllers/issues_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-16 21:00:11 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-16 21:00:11 +0000
commitd4e6355eb3f220787e9374eeef6fb496f213f0d1 (patch)
tree1fe20acbf595c1df2407cc563ed37acf74292c10 /app/controllers/issues_controller.rb
parenta8f98bb74903954f28c4299f4ea7a7279d9028dd (diff)
downloadredmine-d4e6355eb3f220787e9374eeef6fb496f213f0d1.tar.gz
redmine-d4e6355eb3f220787e9374eeef6fb496f213f0d1.zip
Better handling of attachments when issue validation fails (#10253).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8891 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/issues_controller.rb')
-rw-r--r--app/controllers/issues_controller.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index 16a0fe723..7adad0008 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -149,8 +149,8 @@ class IssuesController < ApplicationController
def create
call_hook(:controller_issues_new_before_save, { :params => params, :issue => @issue })
+ @issue.save_attachments(params[:attachments])
if @issue.save
- attachments = Attachment.attach_files(@issue, params[:attachments])
call_hook(:controller_issues_new_after_save, { :params => params, :issue => @issue})
respond_to do |format|
format.html {
@@ -181,6 +181,7 @@ class IssuesController < ApplicationController
def update
return unless update_issue_from_params
+ @issue.save_attachments(params[:attachments])
saved = false
begin
saved = @issue.save_issue_with_child_records(params, @time_entry)