Uploaded image for project: 'Magnolia DAM Module'
  1. Magnolia DAM Module
  2. MGNLDAM-697

#damfn.getRendition throws NPE when using a theme without imaging

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Neutral
    • None
    • None
    • None
    • None

    Description

      When using a theme, and if the theme does not configure imaging, damfn.getRendition throws an NPE.
      This happens e,g, when using the components image or textImage from mtk.

      ftl error comes from this line:

      [#assign rendition = damfn.getRendition(content.image, "original")]
      

      Incomplete theme e.g. looks like this:

      cssFiles:
        bootstrap:
          link: /.resources/multisite-examples-lightmodule/webresources/css/bootstrap.css
          media: all
      

      The problem gets "fixed" when assigning the imaging/class

      cssFiles:
        bootstrap:
          link: /.resources/multisite-examples-lightmodule/webresources/css/bootstrap.css
          media: all
      imaging:
        class: info.magnolia.templating.imaging.VariationAwareImagingSupport
      
      

      I'm not 100% sure whether the bug is really to be fixed on the dam templating functions.

      #damfn.getRendition should be tolerant enough to just use the original asset (which actually works fine if you are not using a theme).

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              Unassigned Unassigned
              cmeier Christoph Meier
              AuthorX
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Checklists

                  Bug DoR
                  Task DoD