Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing links in PR after comments #16877

Closed
1 of 6 tasks
melmus opened this issue Aug 30, 2021 · 4 comments · Fixed by #16956
Closed
1 of 6 tasks

Missing links in PR after comments #16877

melmus opened this issue Aug 30, 2021 · 4 comments · Fixed by #16956
Labels
good first issue Likely to be an easy fix issue/regression Issue needs no code to be fixed, only a description on how to fix it yourself type/bug
Milestone

Comments

@melmus
Copy link

melmus commented Aug 30, 2021

  • Gitea version (or commit ref): v1.15.0
  • Git version: 2.30.2
  • Operating system: Ubuntu 18.04.4 LTS
    Gitea running in docker
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:

Description

After i create PR and our team comments or review PR, message "user commented on this pull request" comes to email, but i do not see link to PR in message. On the screenshots you can see an example of this problem.

Screenshots

recieve_message_from_pr

receive_email2

@noerw noerw added the good first issue Likely to be an easy fix label Aug 31, 2021
@prasadkatti
Copy link
Contributor

Hi. I would like to work on fixing this issue. I have already done some triaging. The issue occurs because the template rendering fails with this error -

...vices/mailer/mail.go:301:composeIssueCommentMessages() [E] ExecuteTemplate [issue/default/body]: template: issue/default:65:10: executing "issue/default" at <.i18n.Tr>: can't evaluate field i18n in type *models.Comment

@zeripath
Copy link
Contributor

zeripath commented Sep 4, 2021

change line 65 in templates/mail/issue/default.tmpl from:

{{.i18n.Tr "mail.issue.in_tree_path" .TreePath}}

to:

			{{$.i18n.Tr "mail.issue.in_tree_path" .TreePath}}

This bug is therefore a regression of #16200

and is backportable to 1.15

@prasadkatti
Copy link
Contributor

prasadkatti commented Sep 5, 2021

@zeripath - Yes, thanks. I figured out that the i18n variable is defined in the outer scope and needs to be referenced using $.

@6543
Copy link
Member

6543 commented Sep 5, 2021

sorry missed that - thanks for the fix

@6543 6543 added this to the 1.15.3 milestone Sep 5, 2021
@6543 6543 added the type/bug label Sep 5, 2021
zeripath pushed a commit that referenced this issue Sep 5, 2021
The mail template rendering was failing with the error -
`...vices/mailer/mail.go:301:composeIssueCommentMessages() [E] ExecuteTemplate [issue/default/body]: template: issue/default:65:10: executing "issue/default" at <.i18n.Tr>: can't evaluate field i18n in type *models.Comment`

The issue was the template variable i18n is available in the outer scope.

Fix #16877
@zeripath zeripath added the issue/regression Issue needs no code to be fixed, only a description on how to fix it yourself label Sep 5, 2021
prasadkatti added a commit to prasadkatti/gitea that referenced this issue Sep 6, 2021
Backport go-gitea#16956

The mail template rendering was failing with the error -
`...vices/mailer/mail.go:301:composeIssueCommentMessages() [E] ExecuteTemplate [issue/default/body]: template: issue/default:65:10: executing "issue/default" at <.i18n.Tr>: can't evaluate field i18n in type *models.Comment`

The issue was the template variable i18n is available in the outer scope.

Fix go-gitea#16877
lunny pushed a commit that referenced this issue Sep 7, 2021
Backport #16956

The mail template rendering was failing with the error -
`...vices/mailer/mail.go:301:composeIssueCommentMessages() [E] ExecuteTemplate [issue/default/body]: template: issue/default:65:10: executing "issue/default" at <.i18n.Tr>: can't evaluate field i18n in type *models.Comment`

The issue was the template variable i18n is available in the outer scope.

Fix #16877

Co-authored-by: 6543 <6543@obermui.de>
@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Likely to be an easy fix issue/regression Issue needs no code to be fixed, only a description on how to fix it yourself type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants