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

Liquid if and unless variable starting with 'empty' creates exception #11012

Closed
PBMikeW opened this issue Jan 12, 2022 · 3 comments
Closed

Liquid if and unless variable starting with 'empty' creates exception #11012

PBMikeW opened this issue Jan 12, 2022 · 3 comments

Comments

@PBMikeW
Copy link
Contributor

PBMikeW commented Jan 12, 2022

Liquid if variable starting with 'empty' creates exception

{% if emptyCard %}
<p>Creates Invalid 'if' tag exception in 1.2, worked fine in 1.1</p>
{% endif %}

{% if cardEmpty %}
<p>Works fine</p>
{% endif %}
@Skrypt
Copy link
Contributor

Skrypt commented Jan 12, 2022

/cc @sebastienros

Not sure if this is an issue. Did emptyCard get assigned anything?
And here what is the difference with cardEmpty? We don't see it getting assigned any value either.

@sebastienros
Copy link
Member

sebastienros commented Jan 12, 2022

Probably a bug in the parser because it reads empty which is a keyword and gets confused. In the meantime please don't start your identifiers with empty.

@Skrypt
Copy link
Contributor

Skrypt commented Jan 12, 2022

Ah, I see now, the emptyCard has a string value of 'empty' which doesn't parse correctly. Thanks @sebastienros

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants