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

[5.x] Adds Boolable interface to resolve issues with ArrayableString instances in conditions under some circumstances. #10595

Merged
merged 6 commits into from
Aug 8, 2024

Conversation

JohnathonKoster
Copy link
Contributor

This PR fixes #10589 and replaces #10593 and implements the idea in this comment #10593 (comment). The root cause of the linked issue is that passing values to a tag using the :some_var="var_name" syntax removes the wrapper Value object. In the case of LabeledValue, this will ultimately resolve a value similar to the following when doing the "truthiness" check:

array:3 [
  'value' => null,
  'label' => null,
  'key' => null
]

This PR introduces a new Boolable interface which is now used by the underlying ArrayableString to help Antlers make decisions when performing truthiness checks.

@jasonvarga jasonvarga merged commit 6e93d96 into statamic:5.x Aug 8, 2024
16 checks passed
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.

Ternary statement in partial evaluates as true for null values
2 participants