gitea/models/issues
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
..
assignees_test.go
assignees.go
comment_code.go Show outdated comments in files changed tab (#24936) (#25428) 2023-06-22 08:34:42 +00:00
comment_list.go
comment_test.go Show outdated comments in files changed tab (#24936) (#25428) 2023-06-22 08:34:42 +00:00
comment.go Replace interface{} with any (#25686) (#25687) 2023-07-04 23:41:32 -04:00
content_history_test.go
content_history.go
dependency_test.go
dependency.go
issue_index.go
issue_label.go
issue_list_test.go Fix empty project displayed in issue sidebar (#25802) (#25854) 2023-07-12 19:07:03 +02:00
issue_list.go Improve loadprojects for issue list (#25468) (#25493) 2023-06-26 02:06:58 +00:00
issue_lock.go
issue_project.go Fix empty project displayed in issue sidebar (#25802) (#25854) 2023-07-12 19:07:03 +02:00
issue_search.go
issue_stats.go
issue_test.go Fix empty project displayed in issue sidebar (#25802) (#25854) 2023-07-12 19:07:03 +02:00
issue_update.go Replace interface{} with any (#25686) (#25687) 2023-07-04 23:41:32 -04:00
issue_user_test.go
issue_user.go
issue_watch_test.go
issue_watch.go
issue_xref_test.go
issue_xref.go
issue.go Replace interface{} with any (#25686) (#25687) 2023-07-04 23:41:32 -04:00
label_test.go
label.go
main_test.go
milestone_test.go
milestone.go
pull_list.go
pull_test.go
pull.go
reaction_test.go
reaction.go
review_test.go
review.go Replace interface{} with any (#25686) (#25687) 2023-07-04 23:41:32 -04:00
stopwatch_test.go
stopwatch.go
tracked_time_test.go
tracked_time.go