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 · 4 comments

Comments

Projects
None yet
4 participants
@moorereason
Contributor

moorereason commented Feb 24, 2017

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

This comment has been minimized.

Show comment
Hide comment
@kaushalmodi

kaushalmodi Feb 24, 2017

Member

Related: #3089

Thanks for fixing this!

Member

kaushalmodi commented Feb 24, 2017

Related: #3089

Thanks for fixing this!

@moorereason moorereason added this to the v0.20 milestone Mar 1, 2017

@bep bep closed this in #3093 Mar 1, 2017

bep added a commit that referenced this issue Mar 1, 2017

@kaushalmodi

This comment has been minimized.

Show comment
Hide comment
@kaushalmodi

kaushalmodi Mar 1, 2017

Member

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"

Member

kaushalmodi commented Mar 1, 2017

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

This comment has been minimized.

Show comment
Hide comment
@bep

bep Mar 26, 2017

Member

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

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

tpl/collections: Log an error on unsupported types in IsSet
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 added a commit that referenced this issue May 18, 2017

tpl/collections: Log an error on unsupported types in IsSet
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

@ghost ghost referenced this issue May 22, 2017

Open

spf13/hugo v0.21 released #10

@vielmetti

This comment has been minimized.

Show comment
Hide comment
@vielmetti

vielmetti Jun 26, 2017

Contributor

Looks like this affects the "Casper" theme.

Contributor

vielmetti commented Jun 26, 2017

Looks like this affects the "Casper" theme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment