mirror of
1
Fork 0
forgejo/models
Giteabot c334be8284
Fix empty project displayed in issue sidebar () ()
Backport  by @yp05327

You can confirm this issue in
https://try.gitea.io/yp05327/testrepo/issues/2

Before:

![image](https://github.com/go-gitea/gitea/assets/18380374/1ab476dc-2f9b-4c85-9e87-105fc73af1ee)
After:

![image](https://github.com/go-gitea/gitea/assets/18380374/786f984d-5c27-4eff-b3d9-159f68034ce4)

This issue comes from the change in .
`LoadProject` will always return at least one record, so we use
`ProjectID` to check whether an issue is linked to a project in the old
code.
As other `issue.LoadXXX` functions, we need to check the return value
from `xorm.Session.Get`.

In recent unit tests, we only test `issueList.LoadAttributes()` but
don't test `issue.LoadAttributes()`. So I added a new test for
`issue.LoadAttributes()` in this PR.

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: Denys Konovalov <privat@denyskon.de>
2023-07-12 19:07:03 +02:00
..
actions Fix content holes in Actions task logs file () () 2023-06-28 23:39:23 +00:00
activities
admin Replace `interface{}` with `any` () () 2023-07-04 23:41:32 -04:00
asymkey Replace `interface{}` with `any` () () 2023-07-04 23:41:32 -04:00
auth
avatars Avoid warning for system setting when start up () 2023-02-24 18:23:13 +08:00
db Replace `interface{}` with `any` () () 2023-07-04 23:41:32 -04:00
dbfs Fix content holes in Actions task logs file () () 2023-06-28 23:39:23 +00:00
fixtures Fix incorrect oldest sort in project list () () 2023-07-12 13:22:17 +08:00
git Replace `interface{}` with `any` () () 2023-07-04 23:41:32 -04:00
issues Fix empty project displayed in issue sidebar () () 2023-07-12 19:07:03 +02:00
migrations Replace `interface{}` with `any` () () 2023-07-04 23:41:32 -04:00
organization Remove unused code () () 2023-07-09 19:47:58 +00:00
packages Test if container blob is accessible before mounting () () 2023-07-09 12:00:04 +00:00
perm
project Fix incorrect oldest sort in project list () () 2023-07-12 13:22:17 +08:00
pull
repo For API attachments, use API URL () () 2023-07-10 12:56:16 +00:00
secret
shared/types
system Replace `interface{}` with `any` () () 2023-07-04 23:41:32 -04:00
unit
unittest Replace `interface{}` with `any` () () 2023-07-04 23:41:32 -04:00
user Replace `interface{}` with `any` () () 2023-07-04 23:41:32 -04:00
webhook Replace `interface{}` with `any` () () 2023-07-04 23:41:32 -04:00
error.go
fixture_generation.go
fixture_test.go
main_test.go
migrate.go
migrate_test.go
org.go
org_team.go
org_team_test.go
org_test.go
repo.go Replace `interface{}` with `any` () () 2023-07-04 23:41:32 -04:00
repo_collaboration.go
repo_collaboration_test.go
repo_test.go
repo_transfer.go
repo_transfer_test.go