Rock icon indicating copy to clipboard operation
Rock copied to clipboard

Lava comments (single line & multiline) are being displayed in HTML output

Open stanalyst opened this issue 2 years ago • 13 comments

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.

image

Actual Behavior

Some of the single line and multiline comments are visible on the output page...

image

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

stanalyst avatar Aug 28 '23 15:08 stanalyst

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.

mikedotmundy avatar Aug 28 '23 19:08 mikedotmundy

Oh - good call - just confirmed we're seeing it under v15.1 also.

stanalyst avatar Aug 28 '23 20:08 stanalyst

@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 %}

image image

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?

image

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.

nairdo avatar Aug 28 '23 21:08 nairdo

Is it possibly related to this old bug?

https://github.com/SparkDevNetwork/Rock/issues/4975

JimMichael avatar Aug 28 '23 21:08 JimMichael

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.

stanalyst avatar Aug 28 '23 21:08 stanalyst

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 avatar May 17 '24 16:05 dataCollegechurch

@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. image

chead4 avatar May 20 '24 21:05 chead4

No my issue was that nothing was displayed at all. This behavior appears in 16.1 but not 16.5.

dataCollegechurch avatar May 20 '24 22:05 dataCollegechurch

@dataCollegechurch Thanks for getting back to me Tony, looks like this is resolved as data is returned in v16.5.

chead4 avatar Jun 19 '24 22:06 chead4

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.

image image

briankalwat avatar Oct 22 '24 16:10 briankalwat

@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.

chead4 avatar Oct 22 '24 17:10 chead4

Hi @chead4!

Here is the rendered page showing some of the comments being rendered on the page: image

Here's the full markup from the HTML block.

Let me know how else I can help!

briankalwat avatar Oct 23 '24 15:10 briankalwat

@briankalwat Thank you Brian. This will help us with our investigation.

sparkdevnetwork-service avatar Oct 23 '24 18:10 sparkdevnetwork-service

Hey @briankalwat - just wanted to let you know that this has been resolved. Thanks for the assist.

nlabarbera avatar Oct 29 '24 16:10 nlabarbera

Thanks so much @nlabarbera!

briankalwat avatar Oct 30 '24 12:10 briankalwat

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] :-)

JimMichael avatar Oct 30 '24 14:10 JimMichael