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

Page template without dialog throws exception

XMLWordPrintable

      When a page template doesn't have a configured dialog the pages app throws the following exception.

      2023-04-07 07:10:08,550 ERROR nolia.ui.contentapp.browser.ActionExecutionService: An error occurred while executing action [commit]
      info.magnolia.ui.api.action.ActionExecutionException: Action execution failed for action: commit
      	at info.magnolia.ui.api.action.AbstractActionExecutor.execute(AbstractActionExecutor.java:64) ~[magnolia-ui-api-6.2.32.jar:?]
      	at info.magnolia.ui.contentapp.browser.ActionExecutionService.executeAction(ActionExecutionService.java:70) ~[magnolia-ui-framework-6.2.32.jar:?]
              ...
      	...
      Caused by: com.machinezoo.noexception.WrappedException: info.magnolia.ui.api.action.ActionExecutionException: Action execution failed for action: editProperties
      	at com.machinezoo.noexception.WrappingHandler.handle(WrappingHandler.java:12) ~[noexception-1.6.2.jar:?]
              ...
      	...
      Caused by: info.magnolia.ui.api.action.ActionExecutionException: Action execution failed for action: editProperties
      	at info.magnolia.ui.api.action.AbstractActionExecutor.execute(AbstractActionExecutor.java:64) ~[magnolia-ui-api-6.2.32.jar:?]
      	at info.magnolia.ui.contentapp.action.ChainedAction.execute(ChainedAction.java:80) ~[magnolia-ui-framework-6.2.32.jar:?]
              ...
      	...
      Caused by: java.lang.ClassCastException: info.magnolia.module.site.templates.ConfiguredTemplateSettings cannot be cast to info.magnolia.module.site.templates.ReferencingPrototypeTemplateSettings
      	at info.magnolia.pages.app.action.browser.EditPagePropertiesAction.lambda$getDialogFromPrototypeTemplate$2(EditPagePropertiesAction.java:151) ~[magnolia-pages-app-6.2.26.jar:?]
      	at java.util.Optional.map(Optional.java:215) ~[?:1.8.0_261]
      	at info.magnolia.pages.app.action.browser.EditPagePropertiesAction.getDialogFromPrototypeTemplate(EditPagePropertiesAction.java:151) ~[magnolia-pages-app-6.2.26.jar:?]
      	at info.magnolia.pages.app.action.browser.EditPagePropertiesAction.lambda$getDialogId$1(EditPagePropertiesAction.java:136) ~[magnolia-pages-app-6.2.26.jar:?]
      	at java.util.Optional.orElseGet(Optional.java:267) ~[?:1.8.0_261]
      	at info.magnolia.pages.app.action.browser.EditPagePropertiesAction.getDialogId(EditPagePropertiesAction.java:136) ~[magnolia-pages-app-6.2.26.jar:?]
      	at info.magnolia.pages.app.action.browser.EditPagePropertiesAction.lambda$getDialogDefinition$0(EditPagePropertiesAction.java:124) ~[magnolia-pages-app-6.2.26.jar:?]
      	at com.machinezoo.noexception.CheckedExceptionHandler.get(CheckedExceptionHandler.java:1835) ~[noexception-1.6.2.jar:?]
      	at info.magnolia.pages.app.action.browser.EditPagePropertiesAction.getDialogDefinition(EditPagePropertiesAction.java:119) ~[magnolia-pages-app-6.2.26.jar:?]
      	at info.magnolia.ui.dialog.actions.OpenDialogAction.execute(OpenDialogAction.java:96) ~[magnolia-ui-framework-6.2.32.jar:?]
      	at info.magnolia.ui.api.action.AbstractActionExecutor.execute(AbstractActionExecutor.java:62) ~[magnolia-ui-api-6.2.32.jar:?]
      	at info.magnolia.ui.contentapp.action.ChainedAction.execute(ChainedAction.java:80) ~[magnolia-ui-framework-6.2.32.jar:?]
      	at info.magnolia.ui.contentapp.action.ChainedAction.lambda$execute$1(ChainedAction.java:76) ~[magnolia-ui-framework-6.2.32.jar:?]
      	at com.machinezoo.noexception.CheckedExceptionHandler$CheckedConsumer.accept(CheckedExceptionHandler.java:319) ~[noexception-1.6.2.jar:?]
      	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[?:1.8.0_261]
      	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_261]
      	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) ~[?:1.8.0_261]
      	at java.util.Iterator.forEachRemaining(Iterator.java:116) ~[?:1.8.0_261]
      	at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) ~[?:1.8.0_261]
      	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_261]
      	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_261]
      	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:1.8.0_261]
      	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:1.8.0_261]
      	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_261]
      	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) ~[?:1.8.0_261]
      	at info.magnolia.ui.contentapp.action.ChainedAction.execute(ChainedAction.java:76) ~[magnolia-ui-framework-6.2.32.jar:?]
      	at info.magnolia.ui.api.action.AbstractActionExecutor.execute(AbstractActionExecutor.java:62) ~[magnolia-ui-api-6.2.32.jar:?]
      	... 115 more
      

      Reproduce

      • Install magnolia without the travel demo.
      • Find the page template /mtk2/templates/pages/basic.yaml
      • Edit the template and comment out the dialog
      • Try to use the template in the Pages app.

      Expected
      I can use a page template which doesn't have a configured dialog without any exceptions.

      Actual
      The Pages app throws a commit error.

      Notes
      It's related to the site definition. We made changes with PAGES-854 which exposed this. When you have a site definition that doesn't use ReferencingPrototypeTemplateSettings. So any older project which uses the more traditional approach could hit this issue. It is a bit of a niche, corner case, problem.

        Acceptance criteria

          There are no Sub-Tasks for this issue.

              ajuran AntonĂ­n Juran
              rgange Richard Gange
              AuthorX
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved:
                Work Started:

                  Bug DoR
                  Task DoD

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - Not Specified
                    Not Specified
                    Logged:
                    Time Spent - 3h
                    3h