cancel
Showing results for 
Search instead for 
Did you mean: 

FreeMarker WebEngine - Expected a hash, but this has evaluated to a date_or_time_or_datetime

freemann_
Star Contributor
Star Contributor

Hi,

I try to migrate my LTS2019 webEngine app to LTS2021 and I have freemarker code problem .

...
<#function get_date doc modified_date
    <#list doc.children as child>
      <#if modified_date.time?datetime == child.dublincore.modified.time?datetime>
          <#local modified_date = child.dublincore.modified>
      </#if>
      <#if doc.isFolder>
          <#local modified_date = get_date(child, modified_date)>
      </#if>
    </#list>
    <#return modified_date>
</#function>
...

When I try to access docuents, I have this exception :

exception_message : For "." left-hand operand: Expected a hash, but this has evaluated to a date_or_time_or_datetime (wrapper: f.t.SimpleDate):
==> modified_date  [in template "file:/var/lib/nuxeo/server/nxserver/web/root.war/modules/nuxeo-utt/skin/views/Document/index.ftl" at line 21, column 22]

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #if modified_date.time?datetime == ch...  [in template "file:/var/lib/nuxeo/server/nxserver/web/root.war/modules/nuxeo-utt/skin/views/Document/index.ftl" in function "get_date" at line 21, column 17]
	- Reached through: ${get_date(child, child.dublincore.mo...  [in template "file:/var/lib/nuxeo/server/nxserver/web/root.war/modules/nuxeo-utt/skin/views/Document/index.ftl" at line 55, column 29]
	- Reached through: @block name="content"  [in template "file:/var/lib/nuxeo/server/nxserver/web/root.war/modules/nuxeo-utt/skin/views/Document/index.ftl" at line 5, column 1]
	- Reached through: @extends src="base.ftl"  [in template "file:/var/lib/nuxeo/server/nxserver/web/root.war/modules/nuxeo-utt/skin/views/Document/index.ftl" at line 1, column 1]
----

How can I workaround this issue ?

thanks a lot

1 REPLY 1

freemann_
Star Contributor
Star Contributor

Hello

When I try to display child.dublincore.modified.time, I got the same error. So I assume that in LTS2021, the is no more .time attribut in modified date ?

Thanks

Getting started

Attention: Blogs & Forums are in READ-ONLY mode from Oct 9-19 as we transition to our new platform. Learn more.

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.