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 <noreply@anthropic.com>

* Reduce comments a bit

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
This commit is contained in:
TowyTowy
2026-07-09 21:13:14 +02:00
committed by GitHub
parent 3d04c8ef49
commit ad78838ffc

View File

@@ -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);