プロジェクト

全般

プロフィール

Vote #78618

完了

Error displaying time entries filtered by Activity

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Time tracking_13
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
13
version_id:
132
issue_org_id:
26387
author_id:
302563
assigned_to_id:
1
comments:
4
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
130
ステータス-->[Closed]

説明

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!


journals

--------------------------------------------------------------------------------
Fixed in r16808. Thanks for reporting this.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

Admin Redmine さんが3年以上前に更新

  • カテゴリTime tracking_13 にセット
  • 対象バージョン3.4.2_132 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0