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

ContentChannel.ChildContentChannels Lava property is not available using Fluid #5389

Closed
1 task done
JRichmond27 opened this issue Apr 12, 2023 · 1 comment
Closed
1 task done
Labels
Fixed in v16.1 Priority: High Affects most production Rock installs in a way that will be noticed. Type: Bug Confirmed bugs or reports that are very likely to be bugs.

Comments

@JRichmond27
Copy link

JRichmond27 commented Apr 12, 2023

Please go through all the tasks below

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

The ChildContentChannels property of the ContentChannel model is no longer available in the Fluid Lava engine, despite being listed on the Model Map.

Prior to switching over to Fluid, I was not able to access the property using dot notation, but I was able to access it with the Property filter. After migrating to Fluid, I am no longer to access it using either method.

Brian Davis and I ran some tests (see steps to reproduce) on various Rock configs and found the following:

v7.6 DotLiquid:

  • Debug Filter: fail
  • Dot Notation: fail
  • Property Filter: pass

v12.9 DotLiquid:

  • Debug Filter: fail
  • Dot Notation: fail
  • Property Filter: pass

v13.7 DotLiquid:

  • Debug Filter: fail
  • Dot Notation: fail
  • Property Filter: pass

v13.7 Fluid:

  • Debug Filter: fail
  • Dot Notation: fail
  • Property Filter: fail

v14.0 DotLiquid:

  • Debug Filter: fail
  • Dot Notation: fail
  • Property Filter: pass

v14.0 Fluid:

  • Debug Filter: fail
  • Dot Notation: fail
  • Property Filter: fail

v14.2 DotLiquid:

  • Debug Filter: fail
  • Dot Notation: fail
  • Property Filter: pass

More details can be found in this Rock chat thread: https://chat.rockrms.com/channel/lava?msg=YDTi4cA8GrEnKTtBF

Expected Behavior

Assuming the Model Map is correct, the ChildContentChannels property should be available using either dot notation or the Properties filter, and should be listed when using the Debug filter on the Content Channel.

Actual Behavior

The ChildContentChannels property is not available using either dot notation or the Properties filter, and is not included when using the Debug filter on the Content Channel.

Steps to Reproduce

  1. Using a Rock instance that is running the Fluid engine and still has the built in "Messages" and "Message Series" content channels
  2. Run the following Lava either in an HTML block or using the Lava Tester:
{% contentchannel id:'4' %}
    {{ contentchannel | Debug }}
    Dot Notation: {{ contentchannel.ChildContentChannels | Size }}<br>
    {% assign childChannels = contentchannel | Property:'ChildContentChannels' %}
    Property Filter: {{ childChannels | Size }}
{% endcontentchannel %}
  1. Notice that the Debug output does not include ChildContentChannels and both of the size outputs are 0, even though the specified content channel has one child channel.

Rock Version

13.7 (Fluid)

Client Culture Setting

en-US

@JRichmond27 JRichmond27 changed the title ContentChannel.ChildContentChannels Lava property is not available ContentChannel.ChildContentChannels Lava property is not available using Fluid Apr 12, 2023
@nlBayside
Copy link
Contributor

nlBayside commented Apr 18, 2023

In regards to the Model Map block, I think this property shows up as accessible via Lava because of this line:

IsLavaInclude = p.IsDefined( typeof( LavaIncludeAttribute ) ) || p.IsDefined( typeof( LavaVisibleAttribute ) ) || p.IsDefined( typeof( DataMemberAttribute ) ),

In ContentChannel.cs, the property is tagged with three attributes:

[DataMember, LavaHidden, JsonIgnore]

/// <summary>
/// Gets or sets the collection of ContentChannels that this ContentChannel allows as children.
/// </summary>
/// <value>
/// A collection of ContentChannels that this ContentChannel allows as children.
/// </value>
[DataMember, LavaHidden, JsonIgnore]
public virtual ICollection<ContentChannel> ChildContentChannels
{
    get { return _childContentChannels ?? ( _childContentChannels = new Collection<ContentChannel>() ); }
    set { _childContentChannels = value; }
}

Since it has the DataMember Attribute, it would be considered Lava accessible. Maybe there should be a change in the Model Map's code to say "Is Data Member and is not LavaHidden"? Or perhaps checking for LavaVisible too? Not sure what would be the best solution to that, or what other Models if would affect.

@sparkdevnetwork-service sparkdevnetwork-service added Type: Bug Confirmed bugs or reports that are very likely to be bugs. Priority: High Affects most production Rock installs in a way that will be noticed. labels Apr 27, 2023
@sparkdevnetwork-service sparkdevnetwork-service added the Status: In Dev Queue This issue is being worked on, and has someone assigned. label Sep 14, 2023
MrUpsideDown added a commit that referenced this issue Sep 17, 2023
@sparkdevnetwork-service sparkdevnetwork-service removed the Status: In Dev Queue This issue is being worked on, and has someone assigned. label Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed in v16.1 Priority: High Affects most production Rock installs in a way that will be noticed. Type: Bug Confirmed bugs or reports that are very likely to be bugs.
Projects
None yet
Development

No branches or pull requests

4 participants