Gitea: Error regarding removed function IsUserPartOfOrg

Created on 10 Sep 2020  路  4Comments  路  Source: go-gitea/gitea

  • Gitea version (or commit ref): 1.12.4
  • Git version: 1.8.3.1
  • Operating system: CentOS Linux release 7.8.2003 (Core)
  • Database (use [x]):

    • [ ] PostgreSQL

    • [ ] MySQL

    • [ ] MSSQL

    • [x] SQLite

  • Can you reproduce the bug at https://try.gitea.io:
  • Log gist:

Description

Some user pages (the one you see when you go to the url http:// /) show an error message
like this:

template: user/profile:66:91: executing "user/profile" at
<.IsUserPartOfOrg>: can't evaluate field IsUserPartOfOrg in type
*models.User

The error message always show for certain users, other users will correctly display a page

Note that the system had been upgraded recently from gitea-1.8

I checked the source code of the current version and the function IsUserPartOfOrg is indeed no longer there (it was
in version 1.8).
OTOH I can also not see where it is referenced in the current source code, so I don't see what is actually causing the error:

If it is not evident by now: My knowledge of the go language and it's environment is extremely basic.

ATM I am not even sure if the new binary I just built from source is really the active one, for example: The error message
seems to reference the file:

templates/user/profile.tmpl

That file, however, does not reference the missing function at all. Whereas _earlier_ versions of that file were indeed
calling that function around line 66.

However, my gitea server under "server configuration" tells my:

IDA Gitea
Gitea-Version
1.12.4 built with GNU Make 3.82, go1.15.2 : bindata, sqlite, sqlite_unlock_notify

which looks completely as it should.

Any help would be appreciated.

Thomas Boroske

Screenshots

kinquestion

All 4 comments

The user page url was supposed to be http://\/\

Do you have some template files inside the custom/templates folder ?
There might be files from older versions.
*.tmpl - files are normally included as resources inside the executable.
Try to rename the templates-folder and restart the gitea process to see any differences.

@warnat has hit the nail on the head. You need to update your templates

This also explains why I couldn't find the offending code passage in the source of the template for the new binary,
it was found in that old custom directory.

Since this was already closed I guess I don't need to do anything except say: Thank you guys.

Was this page helpful?
0 / 5 - 0 ratings