Issue
- When you create a new structure that includes a date field and try to save it, you receive an error similar to this:
Error executing FreeMarker template
FreeMarker template error:
The following has evaluated to null or missing:
==> staticUtil [in template "com.liferay.dynamic.data.mapping.service_4.1.0_CLASS_LOADER_CONTEXT_com/liferay/dynamic/data/mapping/service/dependencies/ddm/date.ftl" at line 4, column 16]
----
Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----
----
FTL stack trace ("~" means nesting-related):
- Failed at: DATE = staticUtil["java.util.Calendar... [in template "com.liferay.dynamic.data.mapping.service_4.1.0_CLASS_LOADER_CONTEXT_com/liferay/dynamic/data/mapping/service/dependencies/ddm/date.ftl" at line 4, column 9]
Environment
- DXP 7.2
Resolution
- This happens because the Freemarker Engine's settings include a certain variable in the restricted variables.
- To resolve this, please go to System Settings→Template Engines→Freemarker Engine and remove
staticUtil
from the Restricted Variables. Save the new settings and restart Liferay.
Contenido exclusivo para suscriptores.
Una Suscripción Enterprise de Liferay proporciona acceso a más de 1.500 artículos que incluyen las mejores practicas, diagnóstico de problemas y otras soluciones útiles. Inicia sesión para tener un acceso completo.
Inicia sesión