From 34bcd5b80b0e7e60e2c307b0dcc0d9113e68d4b7 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 14 Jun 2008 14:10:47 +0000 Subject: [PATCH] Fixed: Logtime info lost when there's an error updating an issue (#1400). git-svn-id: http://redmine.rubyforge.org/svn/trunk@1535 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/issues_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index c042a80e..a86e9b00 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -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? -- 2.11.0