Bug 21923

Summary: Sort problem in some letters of Patron list
Product: Koha Reporter: Devinim <kohadevinim>
Component: PatronsAssignee: Bugs List <koha-bugs>
Status: RESOLVED DUPLICATE QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: gmcharlt, jonathan.druart, josef.moravec, kyle.m.hall, pasi.kallinen
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21778
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20269
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:

Description Devinim 2018-11-30 09:53:49 UTC
While applying patch Bug 21778, we've seen that some Turkish characters on Surname yield incorrect sort order. 

Ç,İ,Ö,U should come after C,I,O,U.
Comment 1 Devinim 2018-11-30 10:07:31 UTC
Small typo correction

Ç,İ,Ö,Ü should come after C,I,O,U.
Comment 2 paxed 2018-12-07 10:56:22 UTC
(In reply to Devinim from comment #1)
> Small typo correction
> 
> Ç,İ,Ö,Ü should come after C,I,O,U.

This is because Koha uses the generic utf8 collation, producing wrong results for some languages (eg. finnish and swedish) when sorted.

On the database level, change the collation to utf8_turkish_ci or utf8mb4_turkish_ci, for example:

ALTER TABLE borrowers MODIFY surname LONGTEXT COLLATE utf8mb4_turkish_ci;
Comment 3 Jonathan Druart 2018-12-10 19:46:01 UTC
As Pasi said it is expected and I would not consider it a bug.
Comment 4 paxed 2018-12-11 06:07:18 UTC
(In reply to Jonathan Druart from comment #3)
> As Pasi said it is expected and I would not consider it a bug.

The "actual" bug/feature request is bug 20269
Comment 5 Devinim 2018-12-21 07:38:17 UTC
(In reply to paxed from comment #4)
> (In reply to Jonathan Druart from comment #3)
> > As Pasi said it is expected and I would not consider it a bug.
> 
> The "actual" bug/feature request is bug 20269

We should find a way to solve this issue, changing collation is just a workaround not the exast solution. It doesn't solve the problem in some cases, think that university library uses Koha and accept student around the world from tens of nationalities.
Comment 6 paxed 2018-12-21 07:45:41 UTC
(In reply to Devinim from comment #5)
> (In reply to paxed from comment #4)
> > (In reply to Jonathan Druart from comment #3)
> > > As Pasi said it is expected and I would not consider it a bug.
> > 
> > The "actual" bug/feature request is bug 20269
> 
> We should find a way to solve this issue, changing collation is just a
> workaround not the exast solution. It doesn't solve the problem in some
> cases, think that university library uses Koha and accept student around the
> world from tens of nationalities.

In theory, the "correct" collation could be dynamically added to the db queries depending on the user's language setting. I have no idea if that would add performance overhead to the queries.

Going that route, there's also at least the "alphabet" syspref that would have to change depending on the language.
Comment 7 Katrin Fischer 2023-10-07 23:36:28 UTC

*** This bug has been marked as a duplicate of bug 20269 ***