From 45aa4ea7056f5a6cd286715596b64f4163588cd8 Mon Sep 17 00:00:00 2001 From: silverwind Date: Tue, 21 Mar 2023 02:07:14 +0100 Subject: [PATCH] Fix pagination on `/notifications/watching` (#23564) The `q` parameter was not rendered in pagination links because `context.Pagination:AddParam` checks for existance of the parameter in `ctx.Data` where it was absent. Added the parameter there to fix it. --- routers/web/user/notification.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/routers/web/user/notification.go b/routers/web/user/notification.go index e12b41e649..e0aa92879f 100644 --- a/routers/web/user/notification.go +++ b/routers/web/user/notification.go @@ -344,6 +344,9 @@ func NotificationWatching(ctx *context.Context) { page = 1 } + keyword := ctx.FormTrim("q") + ctx.Data["Keyword"] = keyword + var orderBy db.SearchOrderBy ctx.Data["SortType"] = ctx.FormString("sort") switch ctx.FormString("sort") { @@ -378,7 +381,7 @@ func NotificationWatching(ctx *context.Context) { Page: page, }, Actor: ctx.Doer, - Keyword: ctx.FormTrim("q"), + Keyword: keyword, OrderBy: orderBy, Private: ctx.IsSigned, WatchedByID: ctx.Doer.ID,