From: Jean-Philippe Lang Date: Sun, 29 Jun 2008 12:16:58 +0000 (+0000) Subject: Do not silently ignore timelog validation failure on issue edit. X-Git-Tag: 0.8.0-RC1~391 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=32fa1a4e90ebe51e5b3858f82e0efb0f08defe78;p=redmine.git Do not silently ignore timelog validation failure on issue edit. git-svn-id: http://redmine.rubyforge.org/svn/trunk@1603 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 5bc65d2e4..e844d242f 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -175,7 +175,7 @@ class IssuesController < ApplicationController @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 + if (@time_entry.hours.nil? || @time_entry.valid?) && @issue.save # Log spend time if current_role.allowed_to?(:log_time) @time_entry.save diff --git a/app/views/issues/_edit.rhtml b/app/views/issues/_edit.rhtml index 914f7b9c4..ba59c3ae9 100644 --- a/app/views/issues/_edit.rhtml +++ b/app/views/issues/_edit.rhtml @@ -4,6 +4,7 @@ :class => nil, :multipart => true} do |f| %> <%= error_messages_for 'issue' %> + <%= error_messages_for 'time_entry' %>
<% if @edit_allowed || !@allowed_statuses.empty? %>
<%= l(:label_change_properties) %>