Jelajahi Sumber

Fix redirect to wrong view after mark as read (#8552)

fix https://github.com/FreshRSS/FreshRSS/issues/6509
A wrong redirect (to normal view) happened in case of both the big mark as read button on the bottom and the navbar 
one, for reader and global views.
Inverle 1 bulan lalu
induk
melakukan
4a2c93c9e7

+ 1 - 1
app/Controllers/entryController.php

@@ -200,7 +200,7 @@ class FreshRSS_entry_Controller extends FreshRSS_ActionController {
 				$is_read ? _t('feedback.sub.articles.marked_read') : _t('feedback.sub.articles.marked_unread'),
 				[
 					'c' => 'index',
-					'a' => 'index',
+					'a' => Minz_Request::paramStringNull('from') ?? 'index',
 					'params' => $params,
 				],
 				notificationName: 'readAction ',

+ 1 - 0
app/layout/nav_menu.phtml

@@ -125,6 +125,7 @@
 				'state' => FreshRSS_Context::$state,
 				'sort' => FreshRSS_Context::$sort,
 				'order' => FreshRSS_Context::$order,
+				'from' => Minz_Request::actionName(),
 			],
 		];
 

+ 1 - 0
app/views/helpers/stream-footer.phtml

@@ -22,6 +22,7 @@
 			'state' => FreshRSS_Context::$state,
 			'sort' => FreshRSS_Context::$sort,
 			'order' => FreshRSS_Context::$order,
+			'from' => Minz_Request::paramStringNull('from') ?? Minz_Request::actionName(),
 		],
 	];
 

+ 1 - 0
app/views/index/global.phtml

@@ -42,6 +42,7 @@
 	$params = array_filter($_GET, 'is_string', ARRAY_FILTER_USE_KEY);
 	unset($params['c']);
 	unset($params['a']);
+	$params['from'] = 'global';
 	$url_base = [
 		'c' => 'index',
 		'a' => 'normal',