forgejo/routers/web/org
Giteabot c334be8284
Fix empty project displayed in issue sidebar (#25802) (#25854)
Backport #25802 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 #25468.
`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
..
setting Move secrets and runners settings to actions settings (#24200) 2023-04-27 20:08:47 -04:00
home.go Add follow organization and fix the logic of following page (#24345) 2023-04-29 15:13:58 -04:00
main_test.go Support org/user level projects (#22235) 2023-01-20 19:42:33 +08:00
members.go Replace interface{} with any (#25686) (#25687) 2023-07-04 23:41:32 -04:00
org.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
org_labels.go Replace interface{} with any (#25686) (#25687) 2023-07-04 23:41:32 -04:00
projects.go Fix empty project displayed in issue sidebar (#25802) (#25854) 2023-07-12 19:07:03 +02:00
projects_test.go Support org/user level projects (#22235) 2023-01-20 19:42:33 +08:00
setting.go Replace interface{} with any (#25686) (#25687) 2023-07-04 23:41:32 -04:00
setting_oauth2.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
setting_packages.go Add Cargo package registry (#21888) 2023-02-05 18:12:31 +08:00
teams.go Replace interface{} with any (#25686) (#25687) 2023-07-04 23:41:32 -04:00