svn commit: r1308734 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/template/FreeMarkerWorker.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1308734 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/template/FreeMarkerWorker.java

jacopoc
Author: jacopoc
Date: Tue Apr  3 07:46:12 2012
New Revision: 1308734

URL: http://svn.apache.org/viewvc?rev=1308734&view=rev
Log:
this is a workaround to fix errors when loading included templates with a relative path after the migration to Freemarker 2.3.19; I am still investigating the root cause.

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/template/FreeMarkerWorker.java

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/template/FreeMarkerWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/template/FreeMarkerWorker.java?rev=1308734&r1=1308733&r2=1308734&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/template/FreeMarkerWorker.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/template/FreeMarkerWorker.java Tue Apr  3 07:46:12 2012
@@ -650,7 +650,8 @@ public class FreeMarkerWorker {
         }
 
         public String getTemplateLocation() {
-            return templateLocation;
+            // FIXME: this is a workaround to fix errors when loading included templates with a relative path after the migration to Freemarker 2.3.19
+            return (templateLocation != null && templateLocation.startsWith("component:/") && !templateLocation.startsWith("component://"))? templateLocation.substring("component:/".length()):templateLocation;
         }
 
         public long getLastModified() {