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

"." access in Params changed for uncompatible types #6121

Closed
davidsneighbour opened this issue Jul 27, 2019 · 2 comments

Comments

@davidsneighbour
Copy link

commented Jul 27, 2019

Sorry for the misty title. I am not 100% sure but it seems that something changed with the with function in Hugo's latest release. There are several posts in discourse about issues in connection with the with function.

In my case [1] the $.Param function breaks, saying it can't read type string. In another case it can't work with the result of MatchGet [2] (can't read type resource).

[1] https://discourse.gohugo.io/t/access-to-param-subkey-stopped-working-in-0-56-0/19839
[2] https://discourse.gohugo.io/t/hugo-56-cant-evaluate-field-fill-in-type-resource-resource/19838

Either something changed in the handling of this function or we have a bug.

You can use my repo https://github.com/davidsneighbour/samui-samui.de to check. Just clone and run hugo server and after a while it breaks with these errors. It was working in the previous release.

Hugo Static Site Generator v0.56.0/extended linux/amd64 BuildDate: 2019-07-25T21:42:01Z
Using snap on Ubuntu 19.04

@bep bep added this to the v0.56.1 milestone Jul 27, 2019

@bep

This comment has been minimized.

Copy link
Member

commented Jul 27, 2019

I pulled the params function out into a common function to reuse it, so that is probably the cause -- but I'm a little surprised as we should have plenty of tests.

@bep

This comment has been minimized.

Copy link
Member

commented Jul 28, 2019

OK, I see now. I see you use a combination of author (string) and author.name, wich I guess I accidently now throw an error for. Sorry for that.

@bep bep added Bug and removed NeedsInvestigation labels Jul 28, 2019

@bep bep changed the title with function seems to be broken "." access in Params changed for uncompatible types Jul 28, 2019

bep added a commit to bep/hugo that referenced this issue Jul 28, 2019

common/maps: Do not return error on params dot access on incompatible…
… types

This error was introduced in 0.56 and has shown some site breakage in the wild.

Fixes gohugoio#6121

@bep bep closed this in #6124 Jul 28, 2019

bep added a commit that referenced this issue Jul 28, 2019

common/maps: Do not return error on params dot access on incompatible…
… types

This error was introduced in 0.56 and has shown some site breakage in the wild.

Fixes #6121
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.