-
-
Notifications
You must be signed in to change notification settings - Fork 551
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
Broken Conditional with Statamic Upgrade from 3.0.8 to 3.0.9 #2456
Comments
Thanks for pointing this out. Are you able to share your actual condition? Obviously If you're doing |
Hi @jasonvarga yes absoluately: {{ if publication_venue:publication_venue_types:slug !== "journal" and publication_venue:first_year }}
Broken
{{ /if }} Switching the order to: {{ if "journal" !== publication_venue:publication_venue_types:slug and publication_venue:first_year }}
Broken
{{ /if }} did not fix the error. Now I get a new error:
Lloyd |
Thank you Lloyd, this is helpful. |
Should be fixed in 3.0.10 |
It is not fixed in 3.0.10. Upgrading breaks my site. Deleting this portion of code makes my site work again:
Full Error extends to much higher in the code..
Let me know if you want my full site to be sent to you personally, if it helps debug this parsing issue. Lloyd |
For those that may run into this issue, I have resolved the issue by separating out the individual conditions into two separate nested {{ if }} statements. I still believe my original conceptualisation is okay, but not able to be parsed. {{ if publication_venue:publication_venue_types:slug !== "journal" }}
{{ if publication_venue:first_year }}
{{ publication_year subtract="{{publication_venue:first_year}}" add="1" number_suffix="" }}
{{ /if }}
{{ /if }} |
Bug Description
Upgrade from 3.0.8 to 3.0.9 breaks working code. In particular, it breaks an Antlers If statement:
where
publication_venue
is a linked entry from another collection andfirst_year
is an Integer.Of course, in my case,
"test" !== "test"
was a useful bit of code, but I have narrowed it down to this example. I cannot narrow down the second half of the condition with my current knowledge of Statamic.How to Reproduce
Extra Detail
Here is the error I am getting:
Environment
Statamic 3.0.9 Solo
Laravel 6.18.35
PHP 7.4.9
statamic/ssg dev-master
The text was updated successfully, but these errors were encountered: