Template error listing pull requests #667

Closed
opened 2025-11-02 03:32:22 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @cez81 on GitHub (Apr 25, 2017).

  • Gitea version (or commit ref): 1.1.0+139-gb7da5a6
  • Git version: 2.7.4
  • Operating system: Ubuntu 16.04
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:
template: repo/issue/list:12:135: executing "repo/issue/list" at <.PullRequestCtx.Base...>: can't evaluate field Link in type *models.Repository

Description

Trying to list pull requests for repo gives me a template error. Repo is a fork of a mirror repo.
I have tried to reproduce on https://try.gitea.io but can't get same result.

Just looking at the error message it looks like .PullRequestCtx.BaseRepo.Link should be .PullRequestCtx.BaseRepo.RepoLink at https://github.com/go-gitea/gitea/blob/master/templates/repo/issue/list.tmpl#L12

Originally created by @cez81 on GitHub (Apr 25, 2017). - Gitea version (or commit ref): 1.1.0+139-gb7da5a6 - Git version: 2.7.4 - Operating system: Ubuntu 16.04 - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [ ] Not relevant - Log gist: ``` template: repo/issue/list:12:135: executing "repo/issue/list" at <.PullRequestCtx.Base...>: can't evaluate field Link in type *models.Repository ``` ## Description Trying to list pull requests for repo gives me a template error. Repo is a fork of a mirror repo. I have tried to reproduce on https://try.gitea.io but can't get same result. Just looking at the error message it looks like `.PullRequestCtx.BaseRepo.Link` should be `.PullRequestCtx.BaseRepo.RepoLink` at https://github.com/go-gitea/gitea/blob/master/templates/repo/issue/list.tmpl#L12
GiteaMirror added the type/bug label 2025-11-02 03:32:22 -06:00
Author
Owner

@cez81 commented on GitHub (Apr 26, 2017):

Changing field name to RepoLink didn't help. Will continue investigating...

Edit:: I can't quite work out what's wrong. I think the problem is in this area
https://github.com/go-gitea/gitea/blob/master/modules/context/repo.go#L325-L331

When BaseRepo doesn't allow pulls (in this case because it's a mirror), ctx.Repo.PullRequest.BaseRepo isn't set.

I have added some debug outputs in the interesting area here -> a0011bc03e

@cez81 commented on GitHub (Apr 26, 2017): Changing field name to RepoLink didn't help. Will continue investigating... Edit:: I can't quite work out what's wrong. I think the problem is in this area https://github.com/go-gitea/gitea/blob/master/modules/context/repo.go#L325-L331 When BaseRepo doesn't allow pulls (in this case because it's a mirror), ctx.Repo.PullRequest.BaseRepo isn't set. I have added some debug outputs in the interesting area here -> https://github.com/cez81/gitea/commit/a0011bc03e0adb9dc83e56292c44f77b7668fab2
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#667