Project

General

Profile

Actions

Defect #26387

closed

Error displaying time entries filtered by Activity

Added by Ulisse Bemer over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Category:
Time tracking
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Hi,

first of all, thank you for developing this great project.

I noticed that when I'm going into the "Time tracking" section, if I add to the default Date filter also an Activity filter and then I apply it, a red band appears reading:
"An error occurred while executing the query and has been logged. Please report this error to your Redmine administrator."

By reading the log, I tracked down the cause: a JOIN was missing in the time_entry_query that is used to calculate the sum of the hours (the missing JOIN was to the "enumerations" table, that's why it raised an error whenever I added an activity filter.

I solved by changing one line in the app/models/time_entry_query.rb file, from this:

map_total(scope.sum(:hours)) {|t| t.to_f.round(2)}

to this:

map_total(scope.includes(:activity).sum(:hours)) {|t| t.to_f.round(2)}

If it's correct, would you please commit the change to the current tree so that it makes it in the next release?
Thank you!

Actions #1

Updated by Toshi MARUYAMA over 7 years ago

  • Status changed from New to Confirmed
  • Target version set to 3.4.2
  • Affected version changed from 3.4.0 to 3.4.1
Actions #2

Updated by Jean-Philippe Lang over 7 years ago

  • Status changed from Confirmed to Resolved
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Fixed in r16808. Thanks for reporting this.

Actions #3

Updated by Jean-Philippe Lang over 7 years ago

  • Subject changed from Error displaying time entries filtered by Activity - Likely solution inside to Error displaying time entries filtered by Activity
Actions #4

Updated by Jean-Philippe Lang over 7 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF