[PAGES-1407] subnodes should not be included in a json response for inherited node that is filtered out by the predicateClass Created: 06/Oct/23 Updated: 14/Dec/23 Resolved: 21/Nov/23 |
|
| Status: | Closed |
| Project: | Magnolia pages module |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 6.3.0, 6.2.33 |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Riste Drangovski | Assignee: | Canh Nguyen |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Σ Remaining Estimate: | 0d | Remaining Estimate: | 0d |
| Σ Time Spent: | 1d 0.5h | Time Spent: | 1d 0.5h |
| Σ Original Estimate: | Not Specified | Original Estimate: | Not Specified |
| Attachments: |
|
|||||||||||||||||||||||||
| Issue Links: |
|
|||||||||||||||||||||||||
| Sub-Tasks: |
|
|||||||||||||||||||||||||
| Template: | ||||||||||||||||||||||||||
| Acceptance criteria: |
Empty
|
|||||||||||||||||||||||||
| Task DoD: |
[X]*
Doc/release notes changes? Comment present?
[X]*
Downstream builds green?
[X]*
Solution information and context easily available?
[X]*
Tests
[X]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
|||||||||||||||||||||||||
| Bug DoR: |
[X]*
Steps to reproduce, expected, and actual results filled
[X]*
Affected version filled
|
|||||||||||||||||||||||||
| Release notes required: |
Yes
|
|||||||||||||||||||||||||
| Documentation update required: |
Yes
|
|||||||||||||||||||||||||
| Date of First Response: | ||||||||||||||||||||||||||
| Epic Link: | Support | |||||||||||||||||||||||||
| Sprint: | DevX 50, DevX 51 | |||||||||||||||||||||||||
| Story Points: | 3 | |||||||||||||||||||||||||
| Team: | ||||||||||||||||||||||||||
| Work Started: | ||||||||||||||||||||||||||
| Approved: |
Yes
|
|||||||||||||||||||||||||
| Description |
|
Currently if we exclude a node from inheritance with filter predicate ( using predicateClass property of inheritance definition) his child nodes are still added to the json response. Expected behavior would be that once node is filtered out by the filter predicate all it's child nodes to be excluded from inheritance. |
| Comments |
| Comment by Oanh Thai Hoang [ 10/Oct/23 ] |
|
Hi rdrangovski .
I'm in process of discovery this ticket and tried to reproduce this bug. Could you elaborate your use case a bit because I can't reproduce for now
Here is how I set up: Prepare a predicate class: ExtendedFilteredInheritancePredicate.java
Prepare a ** dialog has complex structure for dialog: basic-with-composite
label: Basic With Composite
form:
properties:
composite:
label: Title composite
$type: compositeField
itemProvider:
$type: jcrChildNodeProvider
properties:
title:
label: Title
$type: textField
inherit:
name: inheritable
$type: checkBoxField
label: Inherit
buttonLabel: Inherited by Subpages
defaultValue: false
composite-city:
label: City subnode composite
$type: compositeField
itemProvider:
$type: jcrChildNodeProvider
properties:
city:
label: city
$type: textField
Set inheritance true, and set predicateClass for template like below:
inheritOnNestedAreaWithComposite:
title: Inherit ON (Nested Area With Composite)
dialog: inherit-lm:components/basic-with-composite
inheritance:
enabled: true
components: all
predicateClass: info.magnolia.pages.spa.predicates.ExtendedFilteredInheritancePredicate
Now set inheritable is true for parent page This is how it look like for parent page
This is how JCR of parent look like:
And json response when executing child page:
Because inheritable is true so evaluate node from predicate class is true that why json show inherited nodes.
And then when I set inheritable is false in parent page like below:
And json response when executing child page still show as my expectation. I don't see inherited composite node and his child from parent (composite_inherited_depth_4, composite-city_inherited_depth_5)
I'm looking for your response.
Thank you |
| Comment by Riste Drangovski [ 10/Oct/23 ] |
|
Here is one example where component filtering is not working properly: We have:
Footer component is inherited:
Link list component is not inherited:
Json response includes "Link list" component that should not be inherited (should be filtered out):
So as far as I see there is definitely a problem with the inheritance filter in the delivery endpoint! |
| Comment by Oanh Thai Hoang [ 11/Oct/23 ] |
|
Thank rdrangovski . I can reproduce your case now. |
| Comment by Canh Nguyen [ 21/Nov/23 ] |
|
Note for docs: In case of a nested area in a component, we should config the area inheritance information similar to page's areas. Without configuration, it will work like before without filtering. |