]> source.dussan.org Git - redmine.git/commitdiff
Do not silently ignore timelog validation failure on issue edit.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 29 Jun 2008 12:16:58 +0000 (12:16 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 29 Jun 2008 12:16:58 +0000 (12:16 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1603 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/issues_controller.rb
app/views/issues/_edit.rhtml

index 5bc65d2e4a99ca675aebabc5a2770abc1a437b14..e844d242fed7021484ea5a3901ea9e208ee48cb0 100644 (file)
@@ -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
index 914f7b9c4d26d046d15848f130d36083e37d7cdf..ba59c3ae975d2d8667fd45bf673e3bba5168aeea 100644 (file)
@@ -4,6 +4,7 @@
                                        :class => nil,
                                        :multipart => true} do |f| %>
     <%= error_messages_for 'issue' %>
+    <%= error_messages_for 'time_entry' %>
     <div class="box">
     <% if @edit_allowed || !@allowed_statuses.empty? %>
         <fieldset class="tabular"><legend><%= l(:label_change_properties) %>