mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-07-16 10:02:59 -04:00
Sort labels with locale-aware collation (#9023)
Labels (tags) were sorted by the database's raw byte/ASCII collation via ORDER BY name, so accented or non-Latin label names sorted after all ASCII names instead of near their base letter. Apply the same FreshRSS_Context::localeCompare() sort used for categories, feeds, and shares (#8985) to TagDAO::listTags(), fixing the last remaining sub-item of this issue; the others were already resolved by #6212. Fixes #6211 Co-authored-by: Gerard Alvear <gerard.alvear@logiqd.me>
This commit is contained in:
committed by
GitHub
parent
e95243ae68
commit
e24ac6f21c
@@ -233,7 +233,9 @@ class FreshRSS_TagDAO extends Minz_ModelPdo {
|
||||
$res = $this->fetchAssoc($sql);
|
||||
if ($res !== null) {
|
||||
/** @var list<array{id:int,name:string,unreads:int}> $res */
|
||||
return self::daoToTags($res);
|
||||
$tags = self::daoToTags($res);
|
||||
uasort($tags, static fn(FreshRSS_Tag $a, FreshRSS_Tag $b) => FreshRSS_Context::localeCompare($a->name(), $b->name()));
|
||||
return $tags;
|
||||
} else {
|
||||
$info = $this->pdo->errorInfo();
|
||||
Minz_Log::error('SQL error ' . __METHOD__ . json_encode($info));
|
||||
|
||||
Reference in New Issue
Block a user