[MAGNOLIA-7044] Template exception handler is not set correctly after installation Created: 26/May/17 Updated: 06/Dec/22 Resolved: 24/Nov/22 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | rendering |
| Affects Version/s: | 5.4, 6.2.24 |
| Fix Version/s: | 6.3.0, 6.2.27 |
| Type: | Task | Priority: | Neutral |
| Reporter: | Roman Kovařík | Assignee: | Adam Siska |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Σ Remaining Estimate: | Not Specified | Remaining Estimate: | Not Specified |
| Σ Time Spent: | 1d | Time Spent: | Not Specified |
| Σ Original Estimate: | Not Specified | Original Estimate: | Not Specified |
| Issue Links: |
|
|||||||||||||||||||||||||
| Sub-Tasks: |
|
|||||||||||||||||||||||||
| Template: |
|
|||||||||||||||||||||||||
| Acceptance criteria: |
Empty
|
|||||||||||||||||||||||||
| Task DoR: |
Empty
|
|||||||||||||||||||||||||
| Release notes required: |
Yes
|
|||||||||||||||||||||||||
| Date of First Response: | ||||||||||||||||||||||||||
| Sprint: | Nucleus 24 | |||||||||||||||||||||||||
| Story Points: | 1 | |||||||||||||||||||||||||
| Team: | ||||||||||||||||||||||||||
| Work Started: | ||||||||||||||||||||||||||
| Description |
Steps to reproduce
Expected resultsA yellow freemarker error is rendered. Actual resultsThe freemarker error is not rendered, just logged. WorkaroundRestart the instance. Development notesThe 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). |
| Comments |
| Comment by Roman Kovařík [ 06/Oct/22 ] |
|
Solution: remove @Singleton annotation from the Freemarker helper so FreemarkerRenderer would get fresh/updated instance of FreemarkerHelper with the configured exception handler. |