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

tplimpl: isset should return an error on unsupported type #3092

Closed
moorereason opened this issue Feb 24, 2017 · 6 comments · Fixed by #3093
Closed

tplimpl: isset should return an error on unsupported type #3092

moorereason opened this issue Feb 24, 2017 · 6 comments · Fixed by #3093
Assignees
Milestone

Comments

@moorereason
Copy link
Contributor

switch should have a default case that returns an error when an unsupported reflect.Kind is encountered.

See https://discuss.gohugo.io/t/help-understanding-isset/5577/2

@kaushalmodi
Copy link
Contributor

Related: #3089

Thanks for fixing this!

@moorereason moorereason added this to the v0.20 milestone Mar 1, 2017
@bep bep closed this as completed in #3093 Mar 1, 2017
@kaushalmodi
Copy link
Contributor

Confirmed the fix.. now if I do isset .Site "DisqusShortname", I get:

ERROR 2017/03/01 18:19:13 Error while rendering "page posts/installing-go-toolchain.md": template: /home/kmodi/hugo/kaushalmodi.gitlab.io/themes/refined/layouts/_default/baseof.html:45:10: executing "after_main" at <isset .Site "DisqusS...>: error calling isset: unsupported type "ptr"

@bep
Copy link
Member

bep commented Mar 26, 2017

Reopened -- as this breaks lots of themes and the theme site. Will have to be re-evaluated.

@bep bep modified the milestones: v0.21, v0.20 Mar 26, 2017
moorereason added a commit to moorereason/hugo that referenced this issue May 18, 2017
Unsupported types are currently silently ignored by IsSet.  An earlier
attempt was made to solve the issue by returning an error.  That attempt
was reverted since it broke some existing themes.

So instead, we'll log an error.  Hopefully, people will stop using IsSet
in this way, and we can eventually return an error outright.

Updates gohugoio#3092
bep pushed a commit that referenced this issue May 18, 2017
Unsupported types are currently silently ignored by IsSet.  An earlier
attempt was made to solve the issue by returning an error.  That attempt
was reverted since it broke some existing themes.

So instead, we'll log an error.  Hopefully, people will stop using IsSet
in this way, and we can eventually return an error outright.

Updates #3092
bep added a commit that referenced this issue May 19, 2017
@vielmetti
Copy link
Contributor

Looks like this affects the "Casper" theme.

@saso94
Copy link

saso94 commented Oct 17, 2019

In "hugo-coder" theme, when I start to building site, in the command line there is this warning:

WARNING: calling IsSet with unsupported type "invalid" () will always return false.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

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

Successfully merging a pull request may close this issue.

5 participants