0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-02-07 09:44:30 +01:00
gitea/routers/web/repo
yp05327 8b89563bf1
Fix empty project displayed in issue sidebar (#25802)
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: Denys Konovalov <privat@denyskon.de>
2023-07-12 16:10:35 +02:00
..
actions
setting
activity.go
attachment.go Less naked returns (#25713) 2023-07-07 05:31:56 +00:00
blame.go
branch.go
cherry_pick.go
commit.go
compare.go
download.go Less naked returns (#25713) 2023-07-07 05:31:56 +00:00
editor_test.go
editor.go
find.go
helper_test.go
helper.go
http_test.go
http.go Less naked returns (#25713) 2023-07-07 05:31:56 +00:00
issue_content_history.go Check ctx.Written() for GetActionIssue (#25698) 2023-07-05 18:52:12 +00:00
issue_dependency.go
issue_label_test.go
issue_label.go
issue_lock.go
issue_pin.go Check ctx.Written() for GetActionIssue (#25698) 2023-07-05 18:52:12 +00:00
issue_stopwatch.go
issue_test.go
issue_timetrack.go
issue_watch.go
issue.go For API attachments, use API URL (#25639) 2023-07-10 09:31:19 +00:00
main_test.go
middlewares.go
migrate.go
milestone.go
packages.go
patch.go
projects_test.go
projects.go Fix empty project displayed in issue sidebar (#25802) 2023-07-12 16:10:35 +02:00
pull_review.go Check ctx.Written() for GetActionIssue (#25698) 2023-07-05 18:52:12 +00:00
pull.go Show edit title button on commits tab of PR, too (#25791) 2023-07-10 09:05:59 +02:00
release_test.go
release.go Fix tags header and pretty format numbers (#25624) 2023-07-05 04:11:42 +00:00
render.go
repo.go
search.go
topic.go
treelist.go
view_test.go
view.go Exclude default branch from pushed branch hint (#25795) 2023-07-10 11:18:55 +00:00
wiki_test.go
wiki.go Less naked returns (#25713) 2023-07-07 05:31:56 +00:00