Uploaded image for project: 'Extended Templating Kit (closed)'
  1. Extended Templating Kit (closed)
  2. MGNLETK-76

NullPointerException when calling MagnoliaTemplatingUtilities.getInstance().createLink(content) from outside a web context

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 2.0.2
    • 1.4.3
    • None
    • None

      I'm calling MagnoliaTemplatingUtilities.getInstance().createLink(content) from outside a web context (code initiated by an activation) and end up with a nullpointerexception in the below method:

      info.magnolia.module.extendedtemplatingkit.DomainNamePathTransformer#transform

      WebContext ctx = MgnlContext.getWebContextOrNull();
      ExtendedAggregationState state = (ExtendedAggregationState) ctx.getAggregationState();
      

      Obviously I end up with a null ctx.. not sure if I'm not allowed to use the MagnoliaTemplatingUtilities outside a web context?

        Acceptance criteria

              had Jan Haderka
              thbr03 Tomas Brimor
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: