Project

General

Profile

Actions

Defect #31287

closed

Ordering wiki pages should not be case sensitive

Added by hyper loop almost 5 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Wiki
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

There is a tricky problems for the ordering of WikiPages under Postgresql, the title is designed to be case insensitive.
https://github.com/redmine/redmine/blob/24ccf9d981d907ec7c8fa3901d0a79bc7f641825/app/models/wiki_page.rb#L49

But when it comes to order the wiki pages, it’s ordered in a case sensitive way, which results in the three WikiPages titled with ["Aac", "Aace_", "ABc", "Acc”] is ordered as `["ABc", "Aac", "Aace_", "Acc"] `, which is not correct since `"Aac", “Aace_"` should precede `"ABc”`.

A quick fix would be change the

 order(:title)
to
order('lower(title)’)
, patch is attached.

The order works well under mysql since mysql will order regardless of the case. But I think it should also work properly under Postgresql.


Files

patch.rb (566 Bytes) patch.rb hyper loop, 2019-05-01 22:01
patch.diff (566 Bytes) patch.diff hyper loop, 2019-05-01 22:03
patch2.diff (520 Bytes) patch2.diff hyper loop, 2019-05-01 22:14
fixed-31287.patch (4.15 KB) fixed-31287.patch Yuichi HARADA, 2019-06-14 02:22
sqlite.png (18 KB) sqlite.png Go MAEDA, 2020-06-18 01:40
Actions

Also available in: Atom PDF