プロジェクト

全般

プロフィール

Vote #81401

完了

Time entries are broken if grouped by project and issue custom fields

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

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

0%

予定工数:
category_id:
14
version_id:
165
issue_org_id:
35115
author_id:
29628
assigned_to_id:
332
comments:
8
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
152
ステータス-->[Closed]

説明

If you have a custom field for project, which can be used for group by filter (e.g. a list format).

If you try to use this custom fields for group by on time entries this throw an exception:

Query::StatementInvalid: Mysql2::Error: Unknown column 'cf_14.value' in 'field list': SELECT COUNT(DISTINCT `time_entries`.`id`) AS count_

This error occurs on project scope and without project scope.

What I found out, till now:

  • this is new with Redmine 4.2
  • with earlier Redmine versions, you cannot select a group by field from other entities implementation

I see the following solutions:

  • allow group by on custom fields from other entities and this error (it looks like the join to custom field is missing)
  • do not offer group by fields of custom fields from other entities

My test environment:

  • Redmine 4.2.0
  • Ruby 2.7.3
  • PostgreSQL 13
  • No plugin

journals

Same problem with MySQL, but the problem should the same with all database types.
--------------------------------------------------------------------------------

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

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

--------------------------------------------------------------------------------
Before r20830, project custom fields were not groupable in associations and this is way this issue was not presented in earlier versions.

--------------------------------------------------------------------------------
For version:"4.2.1", we should restore the old behaviour, I've attached a fix.

Alexander, thanks for reporting this issue. Regarding allow group by on custom fields from other entities, please open a new issue for this and if you have an working patch to implement this, I will be happy to review it for version:"5.0.0".
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Committed the fix. Thank you.
--------------------------------------------------------------------------------


related_issues

relates,Closed,33290,Unnecessary database access when IssueQuery class is defined

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

  • カテゴリCustom fields_14 にセット
  • 対象バージョン4.2.1_165 にセット

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

いいね!0
いいね!0