Defect #1147

Updating tickets add a time log with zero hours

Added by Nick Read over 9 years ago. Updated about 9 years ago.

Status:ClosedStart date:2008-04-30
Priority:HighDue date:
Assignee:-% Done:

0%

Category:Time tracking
Target version:-
Resolution:Fixed Affected version:

Description

Updating a ticket but leaving the "spent time" field empty still add a time log entry with zero hours. These then show up on the spent time details and reports. This issue has only started occuring recently on trunk, possibly since some revision after roughly r1350 (unsure though - can't remember what revision I was at before this started happening).


Related issues

Related to Redmine - Defect #4449: Spent Time Default Value of 0.0 Closed 2009-12-18
Related to Redmine - Defect #3075: Context-menu issue-status change fails under certain circ... Closed 2009-03-30

Associated revisions

Revision 1385
Added by Jean-Philippe Lang over 9 years ago

Fixed: Updating tickets add a time log with zero hours (#1147).

History

#1 Updated by Jean-Philippe Lang over 9 years ago

  • Status changed from New to Closed
  • Priority changed from Normal to High
  • Target version set to 0.7.1
  • Resolution set to Fixed

Fixed in r1385 (caused by r1361).
This can be considered as a severe issue, a 0.7.1 will be released soon.

#2 Updated by David Petersen over 9 years ago

  • Status changed from Closed to Reopened

I don't think this is really resolved. I have a fully updated svn check out of 0.7-stable (svn://rubyforge.org/var/svn/redmine/branches/0.7-stable) and am still having this problem.

#3 Updated by Eric Davis over 9 years ago

David Petersen wrote:

I don't think this is really resolved. I have a fully updated svn check out of 0.7-stable (svn://rubyforge.org/var/svn/redmine/branches/0.7-stable) and am still having this problem.

I just tested this with 0.7-stable and I didn't get an empty time entry at all. Can you confirm the steps you are using to reproduce this issue?

  1. Went to /issues/show/954
  2. Added a new note with an empty Spent time field
  3. No time appears on the issue
  4. No time appears on the Spent Time report

Console reports no time entries either:

>> i = Issue.find(954)
=> #<Issue id: 954 ...>
>> i.time_entries
=> []

#4 Updated by Jean-Philippe Lang over 9 years ago

Time entries previously created by this bug won't be automatically deleted. You have to do it manually.
Do you still have 0 hours time entries that are created when updating a ticket ?

#5 Updated by Eric Davis over 9 years ago

Do you still have 0 hours time entries that are created when updating a ticket ?

Nick Read, if you want to delete the old duplicate entries you can run this command after backing up your database

script/runner -e production "TimeEntry.delete_all('hours <= 0')" 

#6 Updated by Jean-Philippe Lang over 9 years ago

  • Status changed from Reopened to Closed

Please submit a new ticket if this bug reappeared in recent revision.

#7 Updated by David Petersen over 9 years ago

  • Status changed from Closed to Reopened

I am still able to create this with .7.1 .

The database that we are using has a default value set for hours '0'. This is making the Hours field on the page when you update a ticket have the preset value of "0.0" which redmine is then saving in the database as a empty time entry. I haven't been able to get rid of the default value on the db for our live db but I did on the local db and that worked.

Shouldn't redmine not preset the value of the hours field even if there is a default value in the db?

Why if you enter 0 hours in to the field does redmine still accept it?

#8 Updated by Thomas Lecavelier over 9 years ago

David Petersen wrote:

I am still able to create this with .7.1 .

you mean with branch 0.7_STABLE or trunk? Version 0.7.1 wasn't repackaged.

#9 Updated by David Petersen over 9 years ago

0.7_STABLE sorry.

#10 Updated by Jean-Philippe Lang over 9 years ago

  • Target version deleted (0.7.1)

#11 Updated by Mischa The Evil over 9 years ago

While doing some testing regarding issue #1650 I just found out that this is still happening with r1745 of the trunk. I did get an empty time entry while updating an issue using the context-menu.

Steps to reproduce:
  • Created a new issue / Or use an existing issue without spent-time
  • Change the issue using the context-menu (e.g. change priority)
  • 0.00 time appears on the issue
  • 0.00 time appears on the Spent Time report

#12 Updated by Mischa The Evil over 9 years ago

Please ignore my previous comment. It turned out I wasn't using a clean trunk @ r1745.

This issue could be introduced (at least for me) by the patch of issue #1650. See this note on patch #1650.

#13 Updated by Mischa The Evil over 9 years ago

After my rantings above decided to test this issue more precise. Here's what I came up with:

Zero-Hour timelogs are still added using r1745 of the trunk. I did get an empty time entry while updating an issue using the context-menu.

Steps to reproduce:
  • Created a new issue / Or use an existing issue without spent-time
  • Change the issue using the context-menu (e.g. change priority)
  • No time appears on the issue
  • 0.00 time appears on the Spent Time report

Testing this with a export of the current trunk (@ r1773) this is not happening any longer. It seems to be fixed as a side-effect of the changes made in r1765.

#14 Updated by Jean-Philippe Lang about 9 years ago

  • Status changed from Reopened to Closed

I confirm that this is fixed in current trunk.

Also available in: Atom PDF