RE: Error executing FreeMarker template

Jamie Sammons, modified 3 Years ago. New Member Posts: 10 Join Date: 2/28/23 Recent Posts

I am migrating from Liferay Digital Experience Platform version 7.1.10 Liferay Digital Experience Platform 7.4.13. I am migrating a theme as per the following link :https://help.liferay.com/hc/en-us/articles/360018162071-Liferay-Theme-Generator.

I am using this version of java to generate the .jar and it is installed in Liferay:

java version "1.8.0_341"
Java(TM) SE Runtime Environment (build 1.8.0_341-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.341-b10, mixed mode)
Those that when lifting are throwing the following error:
When taking the war from the theme it is throwing the following error:

ERROR [http-nio-8080-exec-1][runtime:59] Error executing FreeMarker template
freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
==> freeMarkerPortletPreferences.setValue  [in template "20099#20135#86793" at line 2, column 32]

----
Tip: It's the step after the last dot that caused this error, not those before it.
----
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: VOID = freeMarkerPortletPreferences.s...  [in template "20099#20135#86793" at line 2, column 25]
----

thumbnail
Jamie Sammons, modified 3 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts

Personally I'd avoid trying to auto-update themes.

There's a big difference in themes for 7.1 and 7.4 and no upgrade tool is going to help you get around those changes.

I'd suggest starting a new 7.4 theme and then overlay your changes from the 7.1 theme back in.