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

issue: Checkbox Template Variable #6648

Open
wants to merge 1 commit into
base: 1.17.x
Choose a base branch
from

Conversation

JediKev
Copy link
Contributor

@JediKev JediKev commented Dec 6, 2023

This addresses an issue where when using a Checkbox on an Email Template the variable is replaced with 1 if checked and doesn't get replaced at all if unchecked. This is due to the BooleanField class not having an asVar() method so it uses the FormField::asVar() method which calls to_php(). This method returns an integer for BooleanField which is not what we want. This adds a new method called asVar() to the BooleanField class that calls toString() which will return Yes if checked and No if unchecked.

This addresses an issue where when using a Checkbox on an Email Template the
variable is replaced with `1` if checked and doesn't get replaced at all if
unchecked. This is due to the `BooleanField` class not having an `asVar()`
method so it uses the `FormField::asVar()` method which calls `to_php()`.
This method returns an integer for BooleanField which is not what we want.
This adds a new method called `asVar()` to the `BooleanField` class that
calls `toString()` which will return `Yes` if checked and `No` if unchecked.
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.

None yet

1 participant