From a397e92c80dd7763528c3013f190dbe50702fd0c Mon Sep 17 00:00:00 2001 From: petervavrinecz <98645804+petervavrinecz@users.noreply.github.com> Date: Mon, 26 Oct 2026 16:12:14 +0100 Subject: [PATCH] fix(issue): prevent redirect to external tracker when built-in tracker is enabled (#39997) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #39354 added support for enabling both internal and external trackers concurrently and introduced separate navigation buttons. However, as originally pointed out during code review on #39354 ([comment](https://github.com/go-gitea/gitea/pull/39354#discussion_r4047774417)): > *"With both trackers enabled and the built-in issue unit readable, this redirect still runs whenever the external URL is nonempty, so `/issues` never reaches the internal issue list in the new combined configuration. Only redirect to the external tracker when the caller cannot read the internal issue unit."* `MustEnableIssues` in `routers/web/repo/issue.go` was still unconditionally redirecting whenever `unit.TypeExternalTracker` is enabled with a non-empty `ExternalTrackerURL`. ### Fix In `routers/web/repo/issue.go`, only redirect to the external tracker URL when the caller cannot read the built-in issue unit (`!ctx.Repo.Permission.CanRead(unit.TypeIssues)`). Signed-off-by: Vavrinecz Péter <98645804+petervavrinecz@users.noreply.github.com> --- routers/web/repo/issue.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go index d00f5d00e0a..1db9b83fbfd 100644 --- a/routers/web/repo/issue.go +++ b/routers/web/repo/issue.go @@ -101,7 +101,7 @@ func MustEnableIssues(ctx *context.Context) { unitExtTracker, err := ctx.Repo.Repository.GetUnit(ctx, unit.TypeExternalTracker) if err == nil { extURL := unitExtTracker.ExternalTrackerConfig().ExternalTrackerURL - if extURL != "" { + if extURL != "" && !ctx.Repo.Permission.CanRead(unit.TypeIssues) { ctx.Redirect(extURL) return }