[MGNLSITE-100] Missing Imaging configuration can lead to exceptions Created: 29/Jul/20  Updated: 08/Mar/21  Resolved: 08/Mar/21

Status: Closed
Project: Magnolia Site Module
Component/s: None
Affects Version/s: 1.3.1
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Richard Gange Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: maintenance, theme
Remaining Estimate: 0d
Time Spent: 5h
Original Estimate: Not Specified

Attachments: Text File image-error.txt    
Issue Links:
relation
is related to MGNLIMG-224 Missing imaging node in the theme lea... Closed
is related to MVT-6 Improve dependency management Open
is related to MGNLIMG-169 Provide image resizing possibility wi... Open
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

 Description   

When using a theme if you have a missing imaging configuration this can lead to exceptions in apps and other places that can be hard to diagnose. By simply adding the imaging node without any sub-configuration the problems can be overcome. It seems logical that ConfiguredTheme class should simply initialize its imaging member by default to avoid such issues.

Recreate the issue by installing a vanilla magnolia without the demo. Inside the Resource Files app perform the following steps:

  • Add a themes registry to the mtk module
  • Add a mtk.yaml theme but leave the file blank
  • Create/Override a dialog to link to the dam:
        image:
          label: Select image
          $type: linkField
          chooser:
            workbenchChooser:
              appName: dam-chooser
    

In the Site app, configure the fallback site definition to use the mtk theme.

From the Pages app try to link to an image in the dam. This creates a stack overflow in the log similar to the one attached image-error.txt.

The dam chooser is configured to create a variation of the image with the name 240. This ends up being passed to the render() method of ImagingBasedAssetRenderer. This calls:

imagingSupport.createLink(jcrDataProperty, renditionName);

Here is the beginning of a bunch or recursive calls that leads to the stack overflow.


Generated at Mon Feb 12 07:12:43 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.