Defect #35115
closedTime entries are broken if grouped by project and issue custom fields
0%
Description
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
Files
Related issues
Updated by Alexander Meindl over 3 years ago
Same problem with MySQL, but the problem should the same with all database types.
Updated by Marius BĂLTEANU over 3 years ago
- Status changed from New to Confirmed
- Assignee set to Marius BĂLTEANU
- Target version set to 4.2.1
Updated by Marius BĂLTEANU over 3 years ago
Before r20830, project custom fields were not groupable in associations and this is way this issue was not presented in earlier versions.
Updated by Marius BĂLTEANU over 3 years ago
- File 0001-Disable-grouping-for-associations-custom-field.patch 0001-Disable-grouping-for-associations-custom-field.patch added
- Assignee deleted (
Marius BĂLTEANU)
For 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 5.0.0.
Updated by Go MAEDA over 3 years ago
- Related to Defect #33290: Unnecessary database access when IssueQuery class is defined added
Updated by Go MAEDA over 3 years ago
- Status changed from Confirmed to Closed
- Assignee set to Go MAEDA
- Resolution set to Fixed
Committed the fix. Thank you.