Fix user settings sidebar showing disabled features on some pages (#36958)

Move UserDisabledFeatures context data into a shared SettingsCtxData
middleware for the /user/settings route group, so it is set consistently
on all pages (including Notifications, Actions, etc.) instead of only on
the handlers that remembered to set it individually.

Fixes #36954
This commit is contained in:
Nicolas
2026-03-23 23:30:48 +01:00
committed by GitHub
parent cf1e4d7c42
commit 86401fd5fd
11 changed files with 9 additions and 27 deletions
-1
View File
@@ -321,7 +321,6 @@ func loadAccountData(ctx *context.Context) {
ctx.Data["Emails"] = emails
ctx.Data["ActivationsPending"] = pendingActivation
ctx.Data["CanAddEmails"] = !pendingActivation || !setting.Service.RegisterEmailConfirm
ctx.Data["UserDisabledFeatures"] = user_model.DisabledFeaturesWithLoginType(ctx.Doer)
if setting.Service.UserDeleteWithCommentsMaxTime != 0 {
ctx.Data["UserDeleteWithCommentsMaxTime"] = setting.Service.UserDeleteWithCommentsMaxTime.String()