Uploaded image for project: 'Magnolia pages module'
  1. Magnolia pages module
  2. PAGES-55

TemplateColumnFormatter should handle invalid (template) defintions so that app stays functional when page has broken template assigned

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Neutral
    • None
    • 5.4.3
    • None
    • None

    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.

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              Unassigned Unassigned
              pmundt Philip Mundt
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD