--- portal-impl/src/com/liferay/portlet/journal/service/impl/JournalArticleLocalServiceImpl.java Thu Jan 15 10:14:12 1970 +++ portal-impl/src/com/liferay/portlet/journal/service/impl/JournalArticleLocalServiceImpl.java Thu Jan 15 10:14:12 1970 @@ -940,23 +940,26 @@ JournalTemplate template = null; try { template = journalTemplatePersistence.findByG_T( article.getGroupId(), templateId); + tokens.put("template_group_id", Long.toString(article.getGroupId())); } catch (NoSuchTemplateException nste1) { try { Group companyGroup = groupLocalService.getCompanyGroup( article.getCompanyId()); template = journalTemplatePersistence.findByG_T( companyGroup.getGroupId(), templateId); + tokens.put("template_group_id", Long.toString(companyGroup.getGroupId())); } catch (NoSuchTemplateException nste2) { if (!defaultTemplateId.equals(templateId)) { template = journalTemplatePersistence.findByG_T( article.getGroupId(), defaultTemplateId); + tokens.put("template_group_id", Long.toString(article.getGroupId())); } else { throw nste1; } } --- portal-impl/src/com/liferay/portlet/journal/util/VelocityTemplateParser.java Thu Jan 15 10:14:12 1970 +++ portal-impl/src/com/liferay/portlet/journal/util/VelocityTemplateParser.java Thu Jan 15 10:14:12 1970 @@ -84,14 +84,15 @@ "request", insertRequestVariables(root.element("request"))); long companyId = GetterUtil.getLong(tokens.get("company_id")); Company company = CompanyLocalServiceUtil.getCompanyById(companyId); long groupId = GetterUtil.getLong(tokens.get("group_id")); + long templateGroupId = GetterUtil.getLong(tokens.get("template_group_id")); String templateId = tokens.get("template_id"); String journalTemplatesPath = VelocityResourceListener.JOURNAL_SEPARATOR + StringPool.SLASH + - companyId + StringPool.SLASH + groupId; + companyId + StringPool.SLASH + templateGroupId; String randomNamespace = PwdGenerator.getPassword(PwdGenerator.KEY3, 4) + StringPool.UNDERLINE; velocityContext.put("company", company); @@ -107,11 +108,11 @@ velocityContext.put("randomNamespace", randomNamespace); script = injectEditInPlace(xml, script); try { - String velocityTemplateId = companyId + groupId + templateId; + String velocityTemplateId = companyId + templateGroupId + templateId; load = VelocityEngineUtil.mergeTemplate( velocityTemplateId, script, velocityContext, unsyncStringWriter); }