Time entries are broken if grouped by project and issue custom fields
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
Updated by Marius BALTEANU over 2 years ago
- File 0001-Disable-grouping-for-associations-custom-field.patch 0001-Disable-grouping-for-associations-custom-field.patch added
- Assignee deleted (
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.