Lava comments (single line & multiline) are being displayed in HTML output
Please go through all the tasks below
- [X] Check this box only after you have successfully completed both the above tasks
Please provide a brief description of the problem. Please do not forget to attach the relevant screenshots from your side.
While preforming alpha testing for v16, we noticed that some of our lava comments were appearing on the output page. It appears to be limited to the Single Line //- & Multiline /- -/ Lava comment types which were added for v12. The behavior was inconsistent though - with some comments from the block showing and others not. So far we have only seen this behavior in HTML blocks.
Expected Behavior
We would expect that all single & multiline comments would NOT be visible on the output page content.
Actual Behavior
Some of the single line and multiline comments are visible on the output page...
Steps to Reproduce
Put an HTML block on the page. Add content that includes single and/or multiline comments. Observe output of that block on the page.
Rock Version
1.16.0.10
Client Culture Setting
en-US
I will add that this is not just an issue in v16.0 Alpha. We have seen this issue in v15.1 too. Trouble is I could never get it to duplicate on the demo server and couldn't find a way to duplicate it consistently in my environment.
Oh - good call - just confirmed we're seeing it under v15.1 also.
@stanalyst We've not been able to reproduce this yet (v15.1 demo site: https://www.rocksolidchurchdemo.com/intranet/shared-documents nor v16.0 pre-alpha site: https://prealpha.rocksolidchurchdemo.com/intranet/shared-documents) using this HTML/Lava:
<div class="alert alert-info">
<h4>Lava Engine</h4>
<p>
This system is currently running the <b>{{ 'LavaEngine' | RockInstanceConfig }}</b> Lava engine.
</p>
</div>
<hr>
<h3>Testing issue 5560</h3>
{% comment %}By Jim M...{% endcomment %}
{% comment %}By Stan Y...{% endcomment %}
/- GroupType 67 = Explo Online - assume person is in only 1 group of this type -/
Did you see those comments ^^^
{% assign groupMember = CurrentPerson | Groups: "25" | First %}
{% assign grp = groupMember.Group.Id| GroupById %}
//- proceed if we found a group
{% if grp != null and grp != empty %}
<b>Welcome...</b>
{% endif %}
We've tried each of the engines, but perhaps there is a particular block/spot where this is occurring in your environment or something particular to your block's settings?
Would you be willing to share some more screenshots of the block settings, full content example, etc? Perhaps there is something else in the earlier content which is causing the problem.
Is it possibly related to this old bug?
https://github.com/SparkDevNetwork/Rock/issues/4975
It does appear to be related to that old bug ... for the example above ... look at the very first line
{% comment %} By Jim M Jan 2021. This block gets a person's Explo Online group, Zoom Link, schedule, and Leader details.{% endcomment %}
That single quote in "person's" caused the problem ... as soon as I removed it the page rendered correctly.
But this still seems like a bug to me. At least now we know the cause and can reproduce it.
I am not sure I would call this a bug but the lava code below doesn't work after the 16.1 upgrade
{% assign var = 'test' %} /- -/
{{var}}
neither does this
{% assign var = 'test' %}
/-
-/
{{var}}
adding a non-space character does work as expected
{% assign var = 'test' %} /- comment-/
{{var}}
@dataCollegechurch Hi Tony
Just to clarify the issue that you have added in the comments. For the input below is your comment/bug that a return should not be displayed before test?
Input:
{% assign var = 'test' %}
/-
-/
|{{var}}|
Output:
My output has a row returned before test.
No my issue was that nothing was displayed at all. This behavior appears in 16.1 but not 16.5.
@dataCollegechurch Thanks for getting back to me Tony, looks like this is resolved as data is returned in v16.5.
This looks to have maybe returned in 17.0.27. Seeing both single-line and multi-line comments rendered on the page in HTML blocks.
What's odd is that not all comments are being rendered, only some of them.
@briankalwat Hi Brian Thanks for reaching out. Please include a screenshot showing the comments that are being displayed and include the data on your HTML block so that we can investigate.
Hi @chead4!
Here is the rendered page showing some of the comments being rendered on the page:
Here's the full markup from the HTML block.
Let me know how else I can help!
@briankalwat Thank you Brian. This will help us with our investigation.
Hey @briankalwat - just wanted to let you know that this has been resolved. Thanks for the assist.
Thanks so much @nlabarbera!
And check out the fix... it's just removing a bunch of checks that were there to presumably try and solve the same problem? [insert head exploding] :-)