aboutsummaryrefslogtreecommitdiff
path: root/app/Models/Context.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2025-07-15 12:39:51 +0200
committerGravatar GitHub <noreply@github.com> 2025-07-15 12:39:51 +0200
commit5f61e426dc90b7b697a46da009af2fc88eed3ad0 (patch)
tree079de4957a207ed08a8de181f4f2649067277933 /app/Models/Context.php
parent8a44d1045a49aa04d16af0bd4c8a0d56cadf1be3 (diff)
Sort by category title, feed title (#7702)
* Sort by category name, feed name fix https://github.com/FreshRSS/FreshRSS/issues/7698 Note that sorting is done with the default SQL collation for now, meaning that lower-case vs. upper-case and diacritics are influencing the sorting order. Improvements left for future work. Watch out that those sorting criteria are slower due to additional joins, additional requests, and poorer indexes. * i18n:pl Co-authored-by: Inverle <inverle@proton.me> * i18n: nl Co-authored-by: Frans de Jonge <fransdejonge@gmail.com> * Fix preserve sort --------- Co-authored-by: Inverle <inverle@proton.me> Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
Diffstat (limited to 'app/Models/Context.php')
-rw-r--r--app/Models/Context.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/Models/Context.php b/app/Models/Context.php
index 749e7e6ff..9a4e0192e 100644
--- a/app/Models/Context.php
+++ b/app/Models/Context.php
@@ -42,7 +42,7 @@ final class FreshRSS_Context {
public static int $state = 0;
/** @var 'ASC'|'DESC' */
public static string $order = 'DESC';
- /** @var 'id'|'date'|'link'|'title'|'rand' */
+ /** @var 'id'|'c.name'|'date'|'f.name'|'link'|'title'|'rand' */
public static string $sort = 'id';
public static int $number = 0;
public static int $offset = 0;
@@ -237,7 +237,7 @@ final class FreshRSS_Context {
$order = Minz_Request::paramString('order', true) ?: FreshRSS_Context::userConf()->sort_order;
self::$order = in_array($order, ['ASC', 'DESC'], true) ? $order : 'DESC';
$sort = Minz_Request::paramString('sort', true) ?: FreshRSS_Context::userConf()->sort;
- self::$sort = in_array($sort, ['id', 'date', 'link', 'title', 'rand'], true) ? $sort : 'id';
+ self::$sort = in_array($sort, ['id', 'c.name', 'date', 'f.name', 'link', 'title', 'rand'], true) ? $sort : 'id';
self::$number = Minz_Request::paramInt('nb') ?: FreshRSS_Context::userConf()->posts_per_page;
if (self::$number > FreshRSS_Context::userConf()->max_posts_per_rss) {
self::$number = max(