From ad78838ffc01059c2d1f20bf8204b21070e925bf Mon Sep 17 00:00:00 2001 From: TowyTowy <85077986+TowyTowy@users.noreply.github.com> Date: Thu, 9 Jul 2026 21:13:14 +0200 Subject: [PATCH] Keep search and state filters when marking articles as read (#9007) * Keep search and state filters when marking articles as read Marking articles as read (e.g. "mark all as read") POSTs to entry?a=read and, for non-AJAX requests, redirects back to the index. That redirect rebuilt its parameters without the current `search` and `state`, so the view fell back to the default state and the active search was dropped, forcing the user to re-apply their filter. Carry `search` and `state` through the redirect, mirroring the existing handling for `order`/`sort`, so the filtered view is preserved. Fixes #8671 Co-Authored-By: Claude Fable 5 * Reduce comments a bit --------- Co-authored-by: Claude Fable 5 Co-authored-by: Alexandre Alapetite --- app/Controllers/entryController.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/Controllers/entryController.php b/app/Controllers/entryController.php index 4d50d9a02..33f526781 100644 --- a/app/Controllers/entryController.php +++ b/app/Controllers/entryController.php @@ -202,6 +202,15 @@ class FreshRSS_entry_Controller extends FreshRSS_ActionController { } if (!$this->ajax) { + // Preserve the active search and read/favourite state filters across the redirect + $search = Minz_Request::paramString('search', plaintext: true); + if ($search !== '') { + $params['search'] = $search; + } + $stateParam = Minz_Request::paramInt('state'); + if ($stateParam !== 0) { + $params['state'] = $stateParam; + } if (FreshRSS_Context::userConf()->sticky_sort) { if (Minz_Request::hasParam('order')) { $params['order'] = Minz_Request::paramString('order', plaintext: true);