Defect #33110

Sort does not work with group by datetime columns

Added by Alexander Meindl 8 months ago. Updated 7 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Issues list
Target version:4.1.1
Resolution:Fixed Affected version:4.1.0

Description

It is not possible to change sort order with introducted group by date columns (see #13803).

If you want to change sort order by clicking on column header, no changes are visible.

0001-Fix-sort-does-not-work-with-group-by-datetime-column.patch Magnifier (2.54 KB) Marius BALTEANU, 2020-03-29 14:43


Related issues

Related to Redmine - Feature #13803: Implement grouping issues by date (start, due, creation, ... Closed

Associated revisions

Revision 19655
Added by Jean-Philippe Lang 7 months ago

Fix sort does not work with group by datetime columns (#33110).

Patch by Marius BALTEANU.

Revision 19665
Added by Jean-Philippe Lang 7 months ago

Merged r19655 to 4.1-stable (#33110).

History

#1 Updated by Go MAEDA 7 months ago

Could you describe more details? I could not find any problem. Rows are sorted if you click the column header.

#2 Updated by Alexander Meindl 7 months ago

Hi,

after testing it again, I found out, that this problem exists only in time entries list and project list. Issue list works as excepted.

E.g. for the bug:

  1. go to spent time list
  2. Group results by: Created (or any other of type TimestampQueryColumn)
  3. try to sort colmns (this does not work for any column)

ps: no plugins are installed for my tests. Redmine 4.1, Ruby 2.6.5, MySQL (also tested it with Postgres)

#3 Updated by Marius BALTEANU 7 months ago

  • Status changed from New to Confirmed

#4 Updated by Marius BALTEANU 7 months ago

  • Related to Feature #13803: Implement grouping issues by date (start, due, creation, update, closing dates) added

#5 Updated by Marius BALTEANU 7 months ago

I've investigated this issue and the sort works, but not as expected because the sort takes into consideration the time of timestamp columns and not only the date value as the grouping does. Also, the problem can be reproduced on issues list as well if you have the correct test data. More details in the patch.

I was to able to fix by using the attached patch. Jean-Philippe, please take a look on this. All tests pass on my CI: https://gitlab.com/redmine-org/redmine/pipelines/130760933

@Alexander, can you confirm the fix, please?

#6 Updated by Marius BALTEANU 7 months ago

  • Subject changed from Sort does not work with group by date columns to Sort does not work with group by datetime columns

#7 Updated by Alexander Meindl 7 months ago

Hi Marius,

thanks for the patch! This solved the problem. Create work and not easy to address the problem.

#8 Updated by Jean-Philippe Lang 7 months ago

  • Status changed from Confirmed to Resolved

Committed, thanks.

#9 Updated by Jean-Philippe Lang 7 months ago

  • Status changed from Resolved to Closed
  • Resolution set to Fixed

Merged.

Also available in: Atom PDF