]> source.dussan.org Git - redmine.git/commitdiff
Fixed: Logtime info lost when there's an error updating an issue (#1400).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 14 Jun 2008 14:10:47 +0000 (14:10 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 14 Jun 2008 14:10:47 +0000 (14:10 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1535 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/issues_controller.rb

index c042a80efc7f0bc8f2f0eaddb95cceda8a90aa10..a86e9b00cadb4d09776c4fbdaeabfad089a1f25f 100644 (file)
@@ -186,13 +186,13 @@ class IssuesController < ApplicationController
         @custom_values = @project.custom_fields_for_issues(@issue.tracker).collect { |x| CustomValue.new(:custom_field => x, :customized => @issue, :value => params["custom_fields"][x.id.to_s]) }
         @issue.custom_values = @custom_values
       end
+      @time_entry = TimeEntry.new(:project => @project, :issue => @issue, :user => User.current, :spent_on => Date.today)
+      @time_entry.attributes = params[:time_entry]
       attachments = attach_files(@issue, params[:attachments])
       attachments.each {|a| journal.details << JournalDetail.new(:property => 'attachment', :prop_key => a.id, :value => a.filename)}
       if @issue.save
         # Log spend time
         if current_role.allowed_to?(:log_time)
-          @time_entry = TimeEntry.new(:project => @project, :issue => @issue, :user => User.current, :spent_on => Date.today)
-          @time_entry.attributes = params[:time_entry]
           @time_entry.save
         end
         if !journal.new_record?