Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-7044

Template exception handler is not set correctly after installation

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • Neutral
    • 6.3.0, 6.2.27
    • 5.4, 6.2.24
    • rendering
    • None
    • Yes
    • Nucleus 24
    • 1

    Description

      Steps to reproduce

      1. Open https://nightly.magnolia-cms.com/.magnolia/admincentral#app:resources:edit;/travel-demo-marketing-tags/templates/pages/main-marketing-tags.ftl:edit
      2. Make the FTL produce an error, e.g. put unclosed expression (${nonExistingVariable}) in the body, save.
      3. Open https://nightly.magnolia-cms.com/.magnolia/admincentral#app:pages-app:detail;/travel:edit

      Expected results

      A yellow freemarker error is rendered.

      Actual results

      The freemarker error is not rendered, just logged.

      Workaround

      Restart the instance.

      Development notes

      The observed component for freemarkerConfig is not initialized at this point:

          public FreemarkerHelper(final FreemarkerConfig freemarkerConfig, TranslationService translationService, MagnoliaConfigurationProperties properties) {
      ...
              cfg.setTemplateExceptionHandler(freemarkerConfig.getTemplateExceptionHandler());
      ...
      

      As a consequence, freemarker errors are not displayed in the page editor (it's using the default ignore handler).
      After restart, FreemarkerConfig is initialized first, then FreemarkerHelper, correctly.
      This has probably something to do with initialising the helper for the installation phase when the observed components are not yet initialised.

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                asiska Adam Siska
                rkovarik Roman Kovařík
                Nucleus
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Work Started:

                  Checklists

                    Task DoR

                    Time Tracking

                      Estimated:
                      Original Estimate - Not Specified
                      Not Specified
                      Remaining:
                      Remaining Estimate - Not Specified
                      Not Specified
                      Logged:
                      Time Spent - 1d
                      1d