{% If %} Command >, <, >=, <= Operators Always Return True When Using Communication Entry Wizard
Description
Using >, <, >= or <= in the Communication Entry Wizard will always return True regardless of the comparison values. This appears to be the case in both the preview and the email that is sent.
First reported by Gary Holeman in RocketChat.
Steps to Reproduce
- Go to 'The New Communication Page'
- Continue through to the Communication Wizard Email Editor Page
- Enter
{% if 2 < 1%} This shouldn't be in the output. {% endif %}into an HTML or Text Entry Block - See that "This shouldn't be in the output." is outputted in the Preview and Sent Email
Expected behavior:
The >, <, >= and <= operators return True based on the values being evaluated.
Actual behavior:
The >, <, >= and <= operators always return True.
Versions
Rock Version: Rock McKinley 11.2 (1.11.2.1)
Client Culture Setting: en-US
I tested this on Rock McKinley 11.3 with the same results.
@JimMichael noticed that this is related to Issue #2674. The only difference appears to be that the discussion in Issue #2674 seems to imply that the issue is only related to the visual WYSIWYG editor whereas I am noticing that the issue appears to be presenting itself in the code version of the WYSIWYG editor as well as the HTML block in the Communication Entry. I'm guessing it's unfixable as well in this case, but thought I would make the distinction just in case a solution could be found for these non-WYSIWYG editors.
From what I am seeing the only current workaround to include a < operator in the Communication Wizard is to pull the code in from an external source such as a shortcode or {% include %}.
We're fighting this too. We enter {% if profileCount > 0 %} in the HTML code editor of the Communication Wizard. After we Complete the code edit, if you inspect it again you find the > has been escaped and it reads {% if profileCount > 0 %}. Note that we are editing the using the code editor. It's being escaped behind the scenes. In this case, the code editor really isn't a code editor. It's trying to sanitize the "code" without understanding Lava syntax.