[PAGES-1316] In headless inherited components are included until second child Created: 01/Sep/23  Updated: 25/Oct/23  Resolved: 28/Sep/23

Status: Closed
Project: Magnolia pages module
Component/s: None
Affects Version/s: None
Fix Version/s: 6.3, 6.2.32

Type: Bug Priority: Neutral
Reporter: Riste Drangovski Assignee: Dai Ha
Resolution: Fixed Votes: 0
Labels: None
Σ Remaining Estimate: 3.75h Remaining Estimate: 3.75h
Σ Time Spent: 4d 6.25h Time Spent: 1d 7.25h
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Attachments: PNG File image-2023-09-01-11-50-12-984.png    
Sub-Tasks:
Key
Summary
Type
Status
Assignee
PAGES-1321 Implement Sub-task Completed Dai Ha  
PAGES-1322 Review Sub-task Closed Oanh Thai Hoang  
PAGES-1323 piQA Sub-task Closed Anh Vu  
PAGES-1324 QA Sub-task Closed Oanh Thai Hoang  
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
Date of First Response:
Epic Link: Support
Sprint: DevX 46, DevX 47
Story Points: 3
Team: DeveloperX
Work Started:
Approved:
Yes

 Description   

Steps to reproduce

  1. create new headless project
  2. define area with enabled inheritance
  3. on root page add component to the area
  4. create page tree branch that is more then 4 levels deep

 

Expected results

All child pages to have inherited components from root page

Actual results

Only first and second child pages have inherited components, child pages that are deeper in the hierarchy don't have inherited components

Workaround

Development notes



 Comments   
Comment by Oanh Thai Hoang [ 07/Sep/23 ]

Discovery output:

This is indeed a bug due to inherited node depth. Even InheritanceNodeWrapper can get correct inherited nodes from parent but those inherited nodes do not by pass child depth filtering due to it's real depth

 

Example:

Let say we have "/parent/main/quotation" is component from "parent". It's depth is 3.

When executing rest for sub-child like "/parent/child/child-2", child-2's depth is 3 so rest can output the inherited node correctly because they are same depth

Problem for rest will occurs when executing rest for sub-child like "/parent/child/child-2/child-3". child-3's depth is 4 while inherited node's depth is 3 so child depth filtering do not consider inherited nodes are child of child-3

 

Solution: We should decorate depth for inherited node to consider it is a child of current area.

 

PR is provided

 

 

Comment by Riste Drangovski [ 14/Sep/23 ]

I don't know if this is connected with the current issue, but inherited nodes should be returned as first in the list (this is how standard magnolia works), currently in the returned json there is no real order in inherited and non-inherited component nodes!

Comment by Christopher Zimmermann [ 14/Sep/23 ]

Just to confirm - From the docs:

Inheritance behaves like this by default:

  • Editable in parent only: Inherited components can be edited only on the parent page. They don’t have toolbars on child pages.
  • Order is inherited: Inherited components are displayed in the same order on parent and child pages.
  • Inherited first: Inherited components are displayed before non-inherited components in the same area.

 

https://docs.magnolia-cms.com/product-docs/6.2/Developing/Templating/Template-definition/Area-definition/Component-inheritance.html

Comment by Oanh Thai Hoang [ 15/Sep/23 ]

Thanks for your feedback rdrangovski . We have a draft PR for the problem of sorting and is under rv+piQA process

Comment by Riste Drangovski [ 15/Sep/23 ]

Great Thx!

Generated at Mon Feb 12 06:27:06 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.