You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I check both Smartypants and Antlers on a field, Smartypants is applied before Antlers. This can cause Antlers to fail since it does not know how to deal with the curly quotes.
How to reproduce
Make sure that content on your pages has both Smartypants and Antlers checked.
Create a page that includes the following.
---
[other YAML omitted]
description: This cat video is the okayest thing ever.
---
Trying to replace...
{{ description | replace("cat", "dog") }}
With quotes...
{{ collection:pages as="pages" }}
{{ pages }}
{{ title }}
{{ /pages }}
{{ /collection:pages }}
Without quotes...
{{ collection:pages }}
{{ title }}
{{ /collection:pages }}
When rendering the page notice that the replacement does not happy, the first collection with an alias does not work. But the last collection does work.
Also related, when Antlers is checked on a field, many other modifiers stop working altogether. It is as though a field with Antlers processing does not pass along a value at all.
The text was updated successfully, but these errors were encountered:
I have discovered that when antlers is turned on for a field, then the field returns an AntlersString instead of a regular PHP string, which causes some modifiers to fail. In my own modifiers I now use a $value="$value"; at the start of the method to make sure I am dealing with a plain string.
I have also learned that if I turn smartypants off in the field definition, but then use the smartypants modifier on the filed, I can both allow Antlers to process the content and smartypants to clean it up.
A good, simple Antlers test case is {{ now | iso_format("YYYY") }} which will fail if the quotes are curled but work fine if they are not.
Bug description
When I check both Smartypants and Antlers on a field, Smartypants is applied before Antlers. This can cause Antlers to fail since it does not know how to deal with the curly quotes.
How to reproduce
content
on your pages has both Smartypants and Antlers checked.When rendering the page notice that the replacement does not happy, the first collection with an alias does not work. But the last collection does work.
Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
Also related, when Antlers is checked on a field, many other modifiers stop working altogether. It is as though a field with Antlers processing does not pass along a value at all.
The text was updated successfully, but these errors were encountered: