You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2012/04/03 09:46:13 UTC

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

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() {