diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-10-19 19:09:47 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-10-19 19:09:47 +0000 |
commit | 0e4e0a795a7259a096fbbecbf12dcd16d99de0e9 (patch) | |
tree | b05ee0e72482c51b939aca1c6f978dc10455da27 /app/controllers | |
parent | ecfc40629f1e9e266b190f54da264f31b153cdb3 (diff) | |
download | redmine-0e4e0a795a7259a096fbbecbf12dcd16d99de0e9.tar.gz redmine-0e4e0a795a7259a096fbbecbf12dcd16d99de0e9.zip |
Fixed: unable to add a file to an issue without entering a note.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@853 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/issues_controller.rb | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index fc35d8d8a..bad778e67 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -94,21 +94,19 @@ class IssuesController < ApplicationController end def add_note - unless params[:notes].empty? - journal = @issue.init_journal(self.logged_in_user, params[:notes]) - if @issue.save - params[:attachments].each { |file| - next unless file.size > 0 - a = Attachment.create(:container => @issue, :file => file, :author => logged_in_user) - journal.details << JournalDetail.new(:property => 'attachment', - :prop_key => a.id, - :value => a.filename) unless a.new_record? - } if params[:attachments] and params[:attachments].is_a? Array - flash[:notice] = l(:notice_successful_update) - Mailer.deliver_issue_edit(journal) if Setting.notified_events.include?('issue_updated') - redirect_to :action => 'show', :id => @issue - return - end + journal = @issue.init_journal(User.current, params[:notes]) + params[:attachments].each { |file| + next unless file.size > 0 + a = Attachment.create(:container => @issue, :file => file, :author => logged_in_user) + journal.details << JournalDetail.new(:property => 'attachment', + :prop_key => a.id, + :value => a.filename) unless a.new_record? + } if params[:attachments] and params[:attachments].is_a? Array + if journal.save + flash[:notice] = l(:notice_successful_update) + Mailer.deliver_issue_edit(journal) if Setting.notified_events.include?('issue_updated') + redirect_to :action => 'show', :id => @issue + return end show end |