Dublicate AppSubUrl in context_menu template #11303

Closed
opened 2025-11-02 09:33:48 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @ghost on GitHub (Jul 22, 2023).

Description

"Copy Link" in templates/repo/issue/view_content/context_menu.tmpl is constructed this way: data-clipboard-text="{{AppSubUrl}}{{$referenceUrl}}". It seems that {{AppSubUrl}} is redundant:

  • $referenceUrl -> .ctxData.Issue.Link -> func (issue *Issue) Link() string
  • func (issue *Issue) Link() string-> fmt.Sprintf("%s/%s/%d", issue.Repo.Link(), path, issue.Index)
  • issue.Repo.Link() -> setting.AppSubURL + "/" + url.PathEscape(repo.OwnerName) + "/" + url.PathEscape(repo.Name)

As you can see there is already AppSubURL in referenceUrl so it looks like that it should be removed from the template.

Gitea Version

1.20

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

docker

Database

SQLite

Originally created by @ghost on GitHub (Jul 22, 2023). ### Description "Copy Link" in `templates/repo/issue/view_content/context_menu.tmpl` is constructed this way: `data-clipboard-text="{{AppSubUrl}}{{$referenceUrl}}"`. It seems that `{{AppSubUrl}}` is redundant: - `$referenceUrl` -> `.ctxData.Issue.Link` -> `func (issue *Issue) Link() string` - `func (issue *Issue) Link() string`-> `fmt.Sprintf("%s/%s/%d", issue.Repo.Link(), path, issue.Index)` - `issue.Repo.Link()` -> `setting.AppSubURL + "/" + url.PathEscape(repo.OwnerName) + "/" + url.PathEscape(repo.Name)` As you can see there is already AppSubURL in referenceUrl so it looks like that it should be removed from the template. ### Gitea Version 1.20 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? docker ### Database SQLite
GiteaMirror added the type/bug label 2025-11-02 09:33:48 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11303