You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Jacques Le Roux <ja...@les7arts.com> on 2016/09/20 18:43:54 UTC

Re: svn commit: r1761586 - in /ofbiz/trunk: applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/Chec kPermissionTransform.java framework/base/src/main/java/org/apache/ofbiz/base/util/template/FreeMarker Worker.java

This is one of the rare cases where it's OK to swallow an exception :)

Thanks Jacopo!

Jacques


Le 20/09/2016 � 16:51, jacopoc@apache.org a �crit :
> Author: jacopoc
> Date: Tue Sep 20 14:51:20 2016
> New Revision: 1761586
>
> URL: http://svn.apache.org/viewvc?rev=1761586&view=rev
> Log:
> Fix for: Freemarker's ignore_missing attribute of the #include directive was not
> working because of an issue in the OFBiz custom TemplateLoader for Freemarker
> templates.
> (OFBIZ-8292)
>
> The OFBiz custom TemplateLoader now returns null if the resource is missing as
> required by the TemplateLoader specification.
> Additional cleanups for unused methods in the FreeMarkerWorker class and some
> minor fine tuning; improved the way errors are rendered: now the full stack
> trace is not shown in the screen but only in the logs.
>
> Thanks: Jacques Le Roux for the report.
>
> Modified:
>      ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/CheckPermissionTransform.java
>      ofbiz/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/template/FreeMarkerWorker.java
>
> +        protected URL getURL(String name) {
> +            URL locationUrl = null;
> +            try {
> +                locationUrl = FlexibleLocation.resolveLocation(name);
> +            } catch (Exception e) {
> +                Debug.logWarning("Unable to locate the template: " + name, module);
> +            }
> +            return locationUrl != null && new File(locationUrl.getFile()).exists()? locationUrl: null;
>           }
>       }
>