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

Template error in version 0.11.0 #207

Closed
Kansattica opened this issue Nov 11, 2019 · 5 comments · Fixed by #209
Closed

Template error in version 0.11.0 #207

Kansattica opened this issue Nov 11, 2019 · 5 comments · Fixed by #209
Labels
Milestone

Comments

@Kansattica
Copy link

I just updated to WriteFreely 0.11.0 from 0.10.0. I downloaded the tarball from the releases page, extracted it into a new place, and copied over my database, keys, and config.ini. I ran the database migration and, when I start writefreely and try to load the home page, I get an error screen and the following message in the console.

ERROR: 2019/11/11 11:57:56 collections.go:820: Unable to render collection index: template: collection.tmpl:74:125: executing "collection" at <.Host>: can't evaluate field Host in type writefreely.PublicPost
ERROR: 2019/11/11 11:57:56 handle.go:508: [Web handler] 500: template: collection.tmpl:74:125: executing "collection" at <.Host>: can't evaluate field Host in type writefreely.PublicPost

I assume this is because your PublicPost struct doesn't have a .Host property, as seen here.

@ghost ghost added the bug label Nov 11, 2019
@ghost
Copy link

ghost commented Nov 11, 2019

Thanks for the report and sorry about the inconvenience. I will investigate now and get a fix up ASAP.

@ghost ghost added ❓ bug? and removed bug labels Nov 11, 2019
@ghost
Copy link

ghost commented Nov 11, 2019

@Kansattica I'm having trouble reproducing this with v0.11.0, I will double check using the release tarball but in the meantime could you share your server config? not the database or anything that should be secret, just the options set in the [app] section of config.ini.

@ghost
Copy link

ghost commented Nov 11, 2019

I can't reproduce with the v0.11.0 tarball either.

The PubicPost does not have a .Host field but the application configuration is passed in with the StaticPage.

@diazepan
Copy link

I confirm the bug. Here are the options in the app section

[app]
site_name = Torta de Frambuesa
host = https://blog.pueseso.club
theme = write
disable_js = false
webfonts = true
single_user = true
open_registration = false
min_username_len = 3
max_blogs = 1
federation = true
public_stats = true
private = false

@thebaer
Copy link
Member

thebaer commented Nov 11, 2019

Confirmed -- this happens only on single-user instances if a blog has pinned posts. Fixing now and will issue a new release shortly.

@thebaer thebaer added bug and removed ❓ bug? labels Nov 11, 2019
@thebaer thebaer added this to the 0.11.1 milestone Nov 11, 2019
thebaer added a commit that referenced this issue Nov 11, 2019
This fixes a template rendering issue caused by bad references to $.Host
in pinned posts links on single-user instances.

Closes #207
@ghost ghost closed this as completed in #209 Nov 11, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

3 participants