diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-02-16 21:00:11 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-02-16 21:00:11 +0000 |
commit | d4e6355eb3f220787e9374eeef6fb496f213f0d1 (patch) | |
tree | 1fe20acbf595c1df2407cc563ed37acf74292c10 /app/controllers/issues_controller.rb | |
parent | a8f98bb74903954f28c4299f4ea7a7279d9028dd (diff) | |
download | redmine-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.rb | 3 |
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) |