Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dublicate AppSubUrl in context_menu template #26060

Closed
ghost opened this issue Jul 22, 2023 · 0 comments · Fixed by #26066
Closed

Dublicate AppSubUrl in context_menu template #26060

ghost opened this issue Jul 22, 2023 · 0 comments · Fixed by #26066
Labels

Comments

@ghost
Copy link

ghost commented 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

@ghost ghost added the type/bug label Jul 22, 2023
KN4CK3R pushed a commit that referenced this issue Jul 23, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Fix #26060
KN4CK3R pushed a commit that referenced this issue Jul 23, 2023
Backport #26066 by @lunny

Fix #26060

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 7, 2023
project-mirrors-bot-tu bot pushed a commit to project-mirrors/forgejo-as-gitea-fork that referenced this issue Jan 23, 2025
…gitea#26067)

Backport go-gitea#26066 by @lunny

Fix go-gitea#26060

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit ab4fd9a)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

0 participants