diff --git a/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java b/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java index 031ae01e92..55df0ea252 100644 --- a/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java +++ b/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java @@ -577,8 +577,8 @@ public class DataResourceWorker implements org.ofbiz.widget.DataResourceWorkerI public static void renderDataResourceAsText(GenericDelegator delegator, String dataResourceId, Appendable out, Map templateContext, Locale locale, String targetMimeTypeId, boolean cache) throws GeneralException, IOException { if (dataResourceId == null) { - throw new GeneralException("Cannot lookup data resource with for a null dataResourceId"); - } + throw new GeneralException("Cannot lookup data resource with for a null dataResourceId"); + } if (templateContext == null) { templateContext = FastMap.newInstance(); } @@ -635,9 +635,8 @@ public class DataResourceWorker implements org.ofbiz.widget.DataResourceWorkerI // no template; or template is NONE; render the data if (UtilValidate.isEmpty(dataTemplateTypeId) || "NONE".equals(dataTemplateTypeId)) { DataResourceWorker.writeDataResourceText(dataResource, targetMimeTypeId, locale, templateContext, delegator, out, true); - - // a template is defined; render the template first } else { + // a template is defined; render the template first templateContext.put("mimeTypeId", targetMimeTypeId); // FTL template diff --git a/applications/content/widget/content/DataResourceForms.xml b/applications/content/widget/content/DataResourceForms.xml index 826fb27e90..9a748e2c29 100644 --- a/applications/content/widget/content/DataResourceForms.xml +++ b/applications/content/widget/content/DataResourceForms.xml @@ -261,7 +261,7 @@ under the License.