Defect #26387
closedError displaying time entries filtered by Activity
0%
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!
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
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.
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
Updated by Jean-Philippe Lang over 7 years ago
- Status changed from Resolved to Closed