-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
dev/core#3962 Add 'boolean' as a filter for tokens #24923
Conversation
No issue was found matching the number given in the pull request title. Please check the issue number. |
(Standard links)
|
PR #24923: dev/core#3962 Add 'boolean'...
PR #24923: dev/core#3962 Add 'boolean'...
No issues for 6 builds, i.e. since build: #52238 |
3c479be
to
ceeee88
Compare
Add unit tests leveraging & demo-ing boolean fitler in greetings
ceeee88
to
6543dfe
Compare
@demeritcowboy I finally fought test hell on this - are you OK to merge it? Good test to code ratio :-) |
Good job fighting tests. I'll take a look later. |
@demeritcowboy for example greetings - ie "Dear Dave" not "Dear Dave" ( special characters are a better example) |
Some minor
|
https: //github.com/civicrm/civicrm-core/pull/24923/files This will allow us to filter on {contact.first_name|boolean} in smarty IF clauses for greetings Bug: T321619 Change-Id: I1caf5439573264218b587f6ebd5f542860d68884
Overview
dev/core#3962 Add 'boolean' as a filter for tokens
Before
Per https://lab.civicrm.org/dev/core/-/issues/3962 it is very difficult to combine smarty with tokens in
text/plain
messages as appostrophes break our existing work-around of using `{if '{contact.first_name}'}{/if}'After
New modifier added
|boolean
e.g `{if '{contact.first_name|boolean}'}{/if}'Technical Details
I was originally going to use the shorter 'bool' on the basis
bool
is a well established shortening ofboolean
within code. But of course not everyone reading it is familiar with that, or English speaking. I decided that as usual the marginal benefits of using an abbreviation don't stack up compared with the advantage of using an actual word that most people will understand (even if they don't understand the syntax)Comments
The PR is mostly tests :-)