Closed
Description
- Gitea version (or commit ref): 1.14.2
- Git version: 2.29.2
- Operating system: Debian/buster
gitea was locally built and is running as a systemd service - Database (use
[x]
):- PostgreSQL
- MySQL
- MSSQL
- SQLite
- Can you reproduce the bug at https://try.gitea.io:
- Yes (provide example URL)
https://try.gitea.io/BracTest/piparallel/issues/7#issuecomment-87880 - No
- Yes (provide example URL)
Description
In a pull request each comment has a link that can be used to reference the comment.
The link can be obtained by
- right clicking on the text "sotho commented 15 hours ago" -> Copy Link (from browser context menu), this gives e.g.:
https://try.gitea.io/BracTest/piparallel/pulls/7#issuecomment-87880 - click on "..." -> "Copy Link" (from gitea context menu), this gives e.g.:
https://try.gitea.io/BracTest/piparallel/issues/7#issuecomment-87880
If the internal issue tracker is enabled the second URL forwards to the first it seems.
If the internal issue tracker is disabled and forwarding to an external tracker, then the second URL does not work properly.
I would expect that both methods should yield the same URL.
For the second method the file templates/repo/issue/view_content/context_menu.tmpl builds the URL:
{{ if .issue }}
{{ $referenceUrl = Printf "%s%s/issues/%d#%s" AppUrl .ctx.Repository.FullName .ctx.Issue.Index .item.HashTag }}
{{ else }}
{{ $referenceUrl = Printf "%s%s/pulls/%d/files#%s" AppUrl .ctx.Repository.FullName .ctx.Issue.Index .item.HashTag }}
{{ end }}
Changing "%s%s/issues/%d#%s" to "%s%s/pulls/%d#%s" fixes it for my use case, but might break the issue tracker?