diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 051f8910..f51188fc 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -112,7 +112,7 @@ class IssuesController < ApplicationController @allowed_statuses = @issue.new_statuses_allowed_to(User.current) @edit_allowed = User.current.allowed_to?(:edit_issues, @project) @priorities = IssuePriority.all - @time_entry = TimeEntry.new + @time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project) respond_to do |format| format.html { render :template => 'issues/show.rhtml' } format.api @@ -265,7 +265,7 @@ private @allowed_statuses = @issue.new_statuses_allowed_to(User.current) @priorities = IssuePriority.all @edit_allowed = User.current.allowed_to?(:edit_issues, @project) - @time_entry = TimeEntry.new + @time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project) @time_entry.attributes = params[:time_entry] @notes = params[:notes] || (params[:issue].present? ? params[:issue][:notes] : nil)