Project

General

Profile

Actions

Defect #6904

closed

Issue Context Menu- Log Time Broken

Added by Dan Seaver almost 14 years ago. Updated almost 14 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Time tracking
Target version:
-
Start date:
2010-11-16
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

While viewing /project/[XXXXX]/issues, if you right click on an issue and select 'Log Time', you get the following error message:

NoMethodError in TimelogController#edit

You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.attributes=
RAILS_ROOT: /Projects/Ruby/Rails/redmine

/Projects/Ruby/Rails/redmine/app/controllers/timelog_controller.rb:113:in `edit'

This is because @time_entry is never initialized, because the line that initialized it was removed in r4248

In r4248, line 114 was removed, the line was

@time_entry ||= TimeEntry.new(:project => @project, :issue => @issue, :user => User.current, :spent_on => User.current.today)

If this line is added back in, the context menu works correctly.

I've added a patch to correct this issue


Files

development.log (1.92 KB) development.log Dan Seaver, 2010-11-16 02:24
timelog_controller.patch (639 Bytes) timelog_controller.patch Dan Seaver, 2010-11-16 02:24
Actions

Also available in: Atom PDF