No functional change, related with "Missing reference to the delegator in

framework/widget/templates/HtmlFormMacroLibrary.ftl"
(OFBIZ-9230)

To reproduce

1. Load test data <SystemProperty systemResourceId="widget" 
systemPropertyId="widget.autocompleter.defaultMinLength" 
systemPropertyValue="3"/> 
2. Open https://localhost:8443/partymgr/control/main
3. You will still get warning below in log file


|EntityUtilProperties          |I| Could not get a system property for 
widget.autocompleter.defaultMinLength : null


jleroux: the reason is in the context of a FTL macro we lose the delegator 
(in context) when calling  
executeMacro(writer, sr.toString()); 
from 
MacroFormRenderer.renderTextField()
So we need to find a way to pass the delegator to be used when evaluating 
the Freemarker template. For now I have simply added a clearer explanation 
of the reason.

Thanks: Wei Zhang for report

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1784259 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacques Le Roux
2017-02-24 10:52:09 +00:00
parent 4ba7d19982
commit 97a98e7d4c
@@ -61,6 +61,10 @@ public final class EntityUtilProperties implements Serializable {
return results;
}
resource = resource.replace(".properties", "");
if (delegator == null) {
Debug.logInfo("Could not get a system property for " + name + ". Reason: the delegator is null", module);
return results;
}
try {
GenericValue systemProperty = EntityQuery.use(delegator)
.from("SystemProperty")