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

Failed to render template "profile_big_avatar" #27416

Closed
IGLOU-EU opened this issue Oct 3, 2023 · 4 comments · Fixed by #27417
Closed

Failed to render template "profile_big_avatar" #27416

IGLOU-EU opened this issue Oct 3, 2023 · 4 comments · Fixed by #27417
Labels

Comments

@IGLOU-EU
Copy link

IGLOU-EU commented Oct 3, 2023

Description

Hi,
Little template issue for me 😄

https://github.com/go-gitea/gitea/blob/main/templates/shared/user/profile_big_avatar.tmpl#L86

Render failed, failed to render template: user/profile, error: template error: builtin(bindata):shared/user/profile_big_avatar:86:87 : executing "shared/user/profile_big_avatar" at <.HasMemberWithUserID>: wrong number of args for HasMemberWithUserID: want 2 got 1
----------------------------------------------------------------------
					{{if (or .Visibility.IsPublic (and ($.SignedUser) (or .Visibility.IsLimited (and (.HasMemberWithUserID $.SignedUserID) .Visibility.IsPrivate) ($.IsAdmin))))}}
					                                                                                  ^
----------------------------------------------------------------------

Thanks

Gitea Version

1.22.0+dev-97-g1c9990c16

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

systemctl stop gitea; cp /usr/bin/gitea /root/gitea.back; curl -L "https://dl.gitea.io/gitea/main/gitea-main-linux-amd64" -o /usr/bin/gitea; systemctl start gitea

Database

SQLite

@delvh
Copy link
Member

delvh commented Oct 3, 2023

Woohoo, another ctx bug…

@IGLOU-EU
Copy link
Author

IGLOU-EU commented Oct 3, 2023

Can I help to solve some ctx bug ?
This is just a ctx arg issue ?

@delvh
Copy link
Member

delvh commented Oct 3, 2023

The linked PR will fix it.
We are simply trying to get rid of some legacy code pattern right now due to which many templates suddenly stop working.
For us maintainers, both the problem and the fix are clear.
If Go templates were typed, this problem wouldn't occur in the first place…

techknowlogick pushed a commit that referenced this issue Oct 4, 2023
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Oct 4, 2023
silverwind pushed a commit that referenced this issue Oct 4, 2023
@Normanras
Copy link

Not sure if this falls within the same CTX bug - I suspect it does. I was trying to add a single script tag to my footer and took the default template from the repo and added to the appropriate place in my $GITEA_CUSTOM directory. This is the error I get when I try to restart Gitea:

2023/10/13 19:44:55 ...ates/htmlrenderer.go:113:initHTMLRenderer() [D] Creating static HTML Renderer
2023/10/13 19:44:55 ...ates/htmlrenderer.go:138:wrapTmplErrMsg() [F] Gitea can't run with template errors: template error: custom:base/head:2 : function "ctx" not defined
----------------------------------------------------------------------
<html lang="{{ctx.Locale.Lang}}" data-theme="{{ThemeName .SignedUser}}">
              ^^^
----------------------------------------------------------------------

Just as an fyi. I assume the PR will fix this too, just wanted to add context in case it was different.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants