when importing a FTL file using import keyword, this freemarker library does not recognize that the global variable, which are already accessible within the host file, shall be accessible within imported file as well.
for example, below host file can access currentObject as global variable, but the same global variable can NOT be accessed within imported file "utilities.ftl".
The cause of aborting was:
FreeMarker template error: The following has evaluated to null or missing:
==> currentObject [in template "macros/utilities.ftl" at line 9, column 22]
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 st
ep of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
FTL stack trace ("~" means nesting-related):
Failed at: #assign rolesData = currentObject.att... [in template "macros/utilities.ftl" at line 9, column 1]
Reached through: #import "../../macros/utilities.ftl" ... [in template "components/identity.ftl" at line 1, column 1]
Reached through: #include "../../compone... [in template "test/react-tests/tempidentity-test.ftl" at line 12, column 1]
when importing a FTL file using import keyword, this freemarker library does not recognize that the global variable, which are already accessible within the host file, shall be accessible within imported file as well.
for example, below host file can access currentObject as global variable, but the same global variable can NOT be accessed within imported file "utilities.ftl".
host.ftl <#assign metadata = currentObject.attributes.meta! > <#assign attributes = currentObject.attributes!>
<#import "../../macros/utilities.ftl" as utilities> <#include "../../components/identity.ftl" >
utilities.ftl <#assign roles= currentObject.attributes.roles>
Error: >>> ABORTED! <<<
The cause of aborting was: FreeMarker template error: The following has evaluated to null or missing: ==> currentObject [in template "macros/utilities.ftl" at line 9, column 22]
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 st ep of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
FTL stack trace ("~" means nesting-related):