Skip to content

Mail templating error when assigning PR #18704

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

Closed
flozzone opened this issue Feb 10, 2022 · 3 comments · Fixed by #18714
Closed

Mail templating error when assigning PR #18704

flozzone opened this issue Feb 10, 2022 · 3 comments · Fixed by #18714
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug
Milestone

Comments

@flozzone
Copy link
Contributor

Gitea Version

1.16.1

Git Version

No response

Operating System

No response

How are you running Gitea?

Plain docker container

Database

PostgreSQL

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Description

When a PR gets assigned to a user (Enable notifications), the HTML fails to be generated:

2022/02/10 13:44:03 ...vices/mailer/mail.go:297:composeIssueCommentMessages() [E] ExecuteTemplate [issue/assigned/body]: template: issue/assigned:12:70: executing "issue/assigned" at <.Issue.Index>: wrong type for value; expected string; got int64

https://github.com/go-gitea/gitea/blob/main/templates/mail/issue/assigned.tmpl#L12

The following is the source of the mail which is received:

<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style>
		.footer { font-size:small; color:#666;}
	</style>
	
	<title>Re: [ORG/repo] [Test] test PR. (#94)</title>
</head>

so it seems to break exactly after the </head>.

Is there a way to convert the type or should <.Issue.Index> return strings?

Screenshots

No response

@flozzone
Copy link
Contributor Author

No custom template is active!

@wxiaoguang wxiaoguang added type/bug issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented labels Feb 10, 2022
@wxiaoguang
Copy link
Contributor

Bug confirmed. There should be no Escape for IssueIndex

@6543 6543 modified the milestones: 1.17.0, 1.16.2 Feb 10, 2022
zeripath added a commit to zeripath/gitea that referenced this issue Feb 10, 2022
Signed-off-by: Andrew Thornton <[email protected]>
lunny added a commit that referenced this issue Feb 11, 2022
* Prevent double encoding of branch names in delete branch

There is a double encoding issue in branch template whereby the branch name
ends up double encoded.

Fix #18709

Signed-off-by: Andrew Thornton <[email protected]>

* and tag name

Signed-off-by: Andrew Thornton <[email protected]>

* And fix #18704

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: Lunny Xiao <[email protected]>
@wxiaoguang
Copy link
Contributor

Wait for backport

@wxiaoguang wxiaoguang reopened this Feb 11, 2022
@wxiaoguang wxiaoguang changed the title [1.16.1] Mail templating error when assigning PR Mail templating error when assigning PR Feb 11, 2022
zeripath added a commit to zeripath/gitea that referenced this issue Feb 12, 2022
)

Backport go-gitea#18714

* Prevent double encoding of branch names in delete branch

There is a double encoding issue in branch template whereby the branch name
ends up double encoded.

Fix go-gitea#18709

Signed-off-by: Andrew Thornton <[email protected]>

* and tag name

Signed-off-by: Andrew Thornton <[email protected]>

* And fix go-gitea#18704

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: Lunny Xiao <[email protected]>
zeripath added a commit that referenced this issue Feb 12, 2022
…8738)

Backport #18714

* Prevent double encoding of branch names in delete branch

There is a double encoding issue in branch template whereby the branch name
ends up double encoded.

Fix #18709

Signed-off-by: Andrew Thornton <[email protected]>

* and tag name

Signed-off-by: Andrew Thornton <[email protected]>

* And fix #18704

Signed-off-by: Andrew Thornton <[email protected]>
@lunny lunny closed this as completed Feb 13, 2022
Chianina pushed a commit to Chianina/gitea that referenced this issue Mar 28, 2022
)

* Prevent double encoding of branch names in delete branch

There is a double encoding issue in branch template whereby the branch name
ends up double encoded.

Fix go-gitea#18709

Signed-off-by: Andrew Thornton <[email protected]>

* and tag name

Signed-off-by: Andrew Thornton <[email protected]>

* And fix go-gitea#18704

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: Lunny Xiao <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants