-
Bug
-
Resolution: Fixed
-
Neutral
-
2.2.1
-
-
Empty show more show less
-
Maintenance 27
-
2
It was pointed out that JcrReferenceResolver always creates absolute links when it could create internal links if we checked for a WebContext. This is similar to what is done in AssetReferenceResolver. The proposal is to wrap the link creation with a conditional statement to check the type of context.
Context currentContext = MgnlContext.getInstance(); if (currentContext instanceof SystemContext) { Context originalContext = ((SystemContext) currentContext).getOriginalContext(); if (originalContext instanceof WebContext) { MgnlContext.setInstance(originalContext); } } String link = LinkUtil.createLink(node); if (!currentContext.equals(MgnlContext.getInstance())) { MgnlContext.setInstance(currentContext); }
Acceptance criteria