Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Duplicate
-
Affects Version/s: 6.1.0 CE GA1
-
Fix Version/s: 6.1.1 CE GA2
-
Component/s: WCM > Web Content Administration
-
Labels:None
-
Environment:liferay 6.1.0 tomcat bundle
-
Liferay Contributor's Agreement:Accept
-
Similar Issues:
Description
We implementing own portlet - this portlet shoudl display web-content by specified articleId.
So, to do it we are using followed code:
<%
JournalArticleDisplay articleDisplay = JournalContentUtil.getDisplay(themeDisplay.getScopeGroupId(), String.valueOf(articleId), null, themeDisplay.getLanguageId(), themeDisplay);
%>
<%= displayArticle == null ? StringPool.BLANK : displayArticle.getContent() %>
this works fine for normal articles - but in case we are trying to display template driven article - we always got null from getDisplay method.
Issue Links
- duplicates
-
LPS-18364
AssetRenderer fails for Journal/Web Content utilising template when embeded in custom portlet due to incorrect class loader
-

Problem in com.liferay.portal.kernel.templateparser.BaseTransformer class - in method transform it creates templateParser (actually com.liferay.portlet.journal.util.VelocityTemplateParser) with using current thread classloader - which is plugins classloader - and failed (since this class is from portal-impl and not available fro plugins).
To fix this bug we need to use portal's classloader and change code in lines starting from 143 to:
if (Validator.isNotNull(templateParserClassName)) {
TemplateParser templateParser = null;
// Fix for
LPS-25992ClassLoader classLoader =
PortalClassLoaderUtil.getClassLoader();
try
{ templateParser = (TemplateParser)InstanceFactory.newInstance(classLoader, templateParserClassName); }catch (Exception e)
{ throw new TransformException(e); }