[MAGNOLIA-5418] Rendering should not fail on single area when more than one component exists in repository Created: 24/Oct/13  Updated: 19/Dec/14  Resolved: 25/Apr/14

Status: Closed
Project: Magnolia
Component/s: rendering
Affects Version/s: None
Fix Version/s: 5.2.5

Type: Improvement Priority: Neutral
Reporter: Tobias Mattsson Assignee: Roman Kovařík
Resolution: Fixed Votes: 0
Labels: support
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
causality
duplicate
is duplicated by BLOSSOM-148 Area defined as Single Type allows to... Closed
is duplicated by BLOSSOM-154 Useful Component Inheritance Use Case Closed
relation
is related to MGNLUI-1586 PageEditor: action availability is in... Closed
is related to MAGNOLIA-5419 Single areas should have access to it... Open
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)

 Description   

If you change the type of an area to single and there are more than one component already present in an area rendering fails with an exception.

Consider the case where the templater is designing his templates and experimenting and changes the type

Or the case where the template is changed on an existing node, then we don't empty the page of things that should not be rendered. Areas that are no longer referenced in the template script won't appear even though they're still there in the content. Conversely we should be more graceful about the fact that there can be more components in there and just not render them.

Caused by: info.magnolia.rendering.engine.RenderException: Can't render area node /home/about/main with name main
	at info.magnolia.templating.elements.AreaElement.end(AreaElement.java:345)
	at info.magnolia.templating.jsp.cms.AbstractTag.doTag(AbstractTag.java:102)
	at org.apache.jsp.templates.blossomSampleModule.pages.main_jsp._jspx_meth_cms_005farea_005f0(main_jsp.java:218)
	at org.apache.jsp.templates.blossomSampleModule.pages.main_jsp._jspService(main_jsp.java:124)
	... 130 more
Caused by: info.magnolia.rendering.engine.RenderException: Can't render single area [node /home/about/main]: expected one component node but found more.
	at info.magnolia.templating.elements.AreaElement.end(AreaElement.java:303)
	... 133 more

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