[MAGNOLIA-5847] override an extended node does not work anymore Created: 23/Jul/14  Updated: 25/Jul/14  Resolved: 25/Jul/14

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: 5.3, 5.3.1
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: Matteo Pelucco Assignee: Roman Kovařík
Resolution: Not an issue Votes: 0
Labels: support
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Immagine 1.png     PNG File Immagine 12.png     PNG File Immagine 2.png    
Issue Links:
Relates
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

If you extend a node, overriding (property "extends = override") of nested nodes is ignored.

Use Case 1: empty "availableComponents"
1) open demo.magnolia-cms.com
2) STK - Template Definitions
3) stkHome
4) open "stage" area
5) clone inside "availableComponents" from main/content area
6) now you see 8 components. Right.
6.1) you can try also with "extends" on stage area (value: /modules/standard-templating-kit/config/site/default/templates/prototype/areas/stage"
7) now place a "override" property under "availableComponents" node.
8) empty "availableComponents" node
9) I expect to see 0 components, but I see again all 8 components

Use Case 2: change "availableComponents" (see screenshots)
1) open demo.magnolia-cms.com
2) STK - Template Definitions
3) stkHome
4) open "stage" area
5) clone inside "availableComponents" from main/content area
6) now you see 8 components. Right.
6.1) you can try also with "extends" on stage area (value: /modules/standard-templating-kit/config/site/default/templates/prototype/areas/stage"
7) now place a "override" property under "availableComponents" node.
8) I expect to see only 6 components (the ones available in main/content area), but I see again all 8 components



 Comments   
Comment by Matteo Pelucco [ 23/Jul/14 ]

We use intensively this option in Magnolia 5.2.x, the issue is not there.

Comment by Daniel Lipp [ 24/Jul/14 ]

Thx for the detailed report Matteo - we'll check and fix ASAP.

Comment by Daniel Lipp [ 25/Jul/14 ]

Node2Bean is still working as expected - I added the missing tests and they run fine on 5.3 as well as 5.2.
https://git.magnolia-cms.com/gitweb/?p=magnolia_main.git;a=commit;h=f66deeda6ea91d2a81633d2f42e4be041398ebb0

Comment by Jan Haderka [ 25/Jul/14 ]

IMHO this is expected behaviour. The transfer of available components from prototype to concrete area under concrete template definition is not happening via extends functionality but via STK template merging. See docu for more details.

Comment by Philip Mundt [ 25/Jul/14 ]

TemplateRegistry also uses Node2Bean and thus receives the correct TemplateDefinition (incl. AreaDefintion and availableComponents).

Suspecting rendering to resolve & display wrong components in comments, such as:

<!-- cms:area content="website:/demo-project/stage" name="stage" availableComponents="standard-templating-kit:components/stages/stkStageXL,standard-templating-kit:components/stages/stkStagePaging" type="single" label="Stage" inherit="false" optional="true" created="true" createAreaNode="true" showAddButton="false" showNewComponentArea="false" -->

Edit: seems to be desired effect to merge prototype with custom tpl definiton. Possible solution could be to not define anything in prototype (as done with content area)?

Comment by Matteo Pelucco [ 25/Jul/14 ]

Jan, I just added the "extends" property as "reinforce". But in 5.2.4, for instance, we are used to override prototype area definitions to empty some undesired component lists. This doesn't work anymore in 5.3, guaranteed. The new attachment (Immagine 12) is done on 5.2.4 (CE) and represents a working case.

Comment by Jan Haderka [ 25/Jul/14 ]

@Matteo can you also show me what components do you have in prototype of your 5.2.4 in main area?

Comment by Matteo Pelucco [ 25/Jul/14 ]

@Jan, you are right. As usual
In our working case, template 1 *extends* template 2, then overrides availableComponents of template 2. Then, merge is performed against prototype, that *doesn't have any components*.
We expected to have the "override" property working also during the merge procedure. Sorry guys.

I think the override property working also during the merge phase would be something nice, allows to easily manage some exceptions, without too much replication of configuration.
But for sure, this issue can be considered NOT A BUG.

M.

Generated at Mon Feb 12 04:08:57 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.