[PAGES-55] TemplateColumnFormatter should handle invalid (template) defintions so that app stays functional when page has broken template assigned Created: 01/Feb/16  Updated: 19/May/22  Resolved: 19/May/22

Status: Closed
Project: Magnolia pages module
Component/s: None
Affects Version/s: 5.4.3
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Philip Mundt Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File pages_app_wont_open.png    
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   

Currently, PagesApp won't open, if there is a page in workspace website with a broken template definition assigned to it. See screenshot.

The stacktrace is

2016-02-01 16:24:54,772 WARN  info.magnolia.event.SimpleEventBus                : Exception caught when dispatching a class info.magnolia.ui.api.location.LocationChangedEvent event with class info.magnolia.ui.framework.app.AppControllerImpl eventHandler.
com.vaadin.ui.Table$CacheUpdateException: Error during Table cache update. Additional causes not shown.
	at com.vaadin.ui.Table.maybeThrowCacheUpdateExceptions(Table.java:1739)
	at com.vaadin.ui.Table.refreshRenderedCells(Table.java:1728)
	at com.vaadin.ui.Table.attach(Table.java:4250)
	at com.vaadin.server.AbstractClientConnector.attach(AbstractClientConnector.java:590)
[..]
Caused by: info.magnolia.config.registry.Registry$InvalidDefinitionException: travel-demo:pages/home
	at info.magnolia.config.registry.DefinitionProviderBuilder$DefinitionProviderImpl.get(DefinitionProviderBuilder.java:127)
	at info.magnolia.config.registry.DefinitionProviderWrapper.get(DefinitionProviderWrapper.java:57)
	at info.magnolia.rendering.template.registry.TemplateDefinitionRegistry$1.get(TemplateDefinitionRegistry.java:121)
	at info.magnolia.rendering.template.registry.TemplateDefinitionRegistry$1.get(TemplateDefinitionRegistry.java:118)
	at info.magnolia.pages.app.column.TemplateColumnFormatter.generateCell(TemplateColumnFormatter.java:108)
	at info.magnolia.personalization.column.PersonalizationTemplateColumnFormatter.generateCell(PersonalizationTemplateColumnFormatter.java:58)
	at com.vaadin.ui.Table.parseItemIdToCells(Table.java:2334)
	at com.vaadin.ui.Table.getVisibleCellsNoCache(Table.java:2195)
	at com.vaadin.ui.Table.refreshRenderedCells(Table.java:1717)
	... 148 more
Howto reproduce
  • Goto demoauthor
  • Open resources app
  • Edit /travel-demo/templates/pages/home.yaml
  • Change property class: info.magnolia.demo.travel.definition._PageTemplateDefinition
  • Open Pages App
Note

Possibly the app stays functional when the problematic template is not assigned to the root page – or to put it differently, break the home template in order to see this issue.

Suggested solution

In the realm of light modules and the possibility to add/change templates in the filesystem we should be more forgiving when handling broken template definitions:

Do not catch info.magnolia.config.registry.Registry$InvalidDefinitionException in info.magnolia.pages.app.column.TemplateColumnFormatter#generateCell but rather ask the info.magnolia.config.registry.DefinitionProvider whether defintion is valid #isValid() and display an error if required.



 Comments   
Comment by Roman Kovařík [ 19/May/22 ]

Hello,

This ticket is now marked as closed due to one of the following reasons:

  • A long period of inactivity
  • Uses an old or Beta version of an application, module, or framework that we no longer support
  • The issue is no longer reproducible or has been fixed in later versions

If you are still facing a problem or consider this issue still relevant, please feel free to re-open the ticket and we will reach out to you.

Thank you,
The Magnolia Team

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