Skip to content

Runtime: evaluate Antlers within code fieldtype when antlers: true is set#5966

Merged
jackmcdade merged 4 commits intostatamic:3.3from
JohnathonKoster:runtime-arrayable-string-fieldtypes-antlers-true
May 2, 2022
Merged

Runtime: evaluate Antlers within code fieldtype when antlers: true is set#5966
jackmcdade merged 4 commits intostatamic:3.3from
JohnathonKoster:runtime-arrayable-string-fieldtypes-antlers-true

Conversation

@JohnathonKoster
Copy link
Copy Markdown
Contributor

This PR closes #5963 by casting instances of ArrayableString to strings when resolving a value for Antlers when the field is configured with antlers: true. This is only done when the site is set to runtime to prevent accidentally breaking something else.

To reproduce the original issue create a code field and set antlers: true on the field and include some Antlers code in the value. The code will not be evaluated before this PR, but will afterwards (the included test will also fail when moved to the main branch as another way to validate).

Copy link
Copy Markdown
Member

@jasonvarga jasonvarga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only done when the site is set to runtime

I think it's pretty safe to assume if it's an ArrayableString and you have antlers enabled, it should treat it as a string. Let's remove the runtime check.

@jackmcdade jackmcdade merged commit cae2547 into statamic:3.3 May 2, 2022
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

Successfully merging this pull request may close these issues.

Code field no longer parses Antlers code

4 participants