1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-22 17:34:03 +03:00
gitea/routers/web
Lunny Xiao cc27b50bdf
Fix a bug returning 404 when display a single tag with no release (#29466)
Partially caused by #29149 

When use

```go
releases, err := getReleaseInfos(ctx, &repo_model.FindReleasesOptions{
		ListOptions: db.ListOptions{Page: 1, PageSize: 1},
		RepoID:      ctx.Repo.Repository.ID,
		TagNames:    []string{ctx.Params("*")},
		// only show draft releases for users who can write, read-only users shouldn't see draft releases.
		IncludeDrafts: writeAccess,
	})
```
replace
```go
release, err := repo_model.GetRelease(ctx, ctx.Repo.Repository.ID, ctx.Params("*"))
```
It missed `IncludeTags: true,`. That means this bug will be occupied only when the release is a tag.
This PR will fix

 - Get the right tag record when it's not a release
 - Display correct tag tab but not release tag when it's a tag.
- The button will bring the tag name to the new page when it's a single tag page
- the new page will automatically hide the release target inputbox when the tag name is pre filled. This should be backport to v1.21.
2024-03-02 14:03:39 +00:00
..
admin migrate some more "OptionalBool" to "Option[bool]" (#29479) 2024-02-29 18:52:49 +00:00
auth Allow to change primary email before account activation (#29412) 2024-02-27 10:55:13 +00:00
devtest Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
events Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
explore migrate some more "OptionalBool" to "Option[bool]" (#29479) 2024-02-29 18:52:49 +00:00
feed Rename Str2html to SanitizeHTML and clarify its behavior (#29516) 2024-03-01 10:16:19 +00:00
healthcheck Always enable caches (#28527) 2023-12-19 09:29:05 +00:00
misc Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
org Rename Str2html to SanitizeHTML and clarify its behavior (#29516) 2024-03-01 10:16:19 +00:00
repo Fix a bug returning 404 when display a single tag with no release (#29466) 2024-03-02 14:03:39 +00:00
shared migrate some more "OptionalBool" to "Option[bool]" (#29479) 2024-02-29 18:52:49 +00:00
user Allow options to disable user gpg keys configuration from the interface on app.ini (#29486) 2024-03-02 01:21:01 +00:00
base.go Fix panic in storageHandler (#27446) 2023-10-06 13:23:14 +00:00
githttp.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
goget.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
home.go migrate some more "OptionalBool" to "Option[bool]" (#29479) 2024-02-29 18:52:49 +00:00
metrics.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
nodeinfo.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
passkey.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
swagger_json.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
web.go Use a predictiable fork URL to allow forking repositories without providing a repo ID (#29519) 2024-03-01 12:52:30 +00:00
webfinger.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00