<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic FreeMarker WebEngine - Expected a hash, but this has evaluated to a date_or_time_or_datetime in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/freemarker-webengine-expected-a-hash-but-this-has-evaluated-to-a/m-p/318337#M5338</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I try to migrate my LTS2019 webEngine app to LTS2021 and I have freemarker code problem .&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;...
&amp;lt;#function get_date doc modified_date
    &amp;lt;#list doc.children as child&amp;gt;
      &amp;lt;#if modified_date.time?datetime == child.dublincore.modified.time?datetime&amp;gt;
          &amp;lt;#local modified_date = child.dublincore.modified&amp;gt;
      &amp;lt;/#if&amp;gt;
      &amp;lt;#if doc.isFolder&amp;gt;
          &amp;lt;#local modified_date = get_date(child, modified_date)&amp;gt;
      &amp;lt;/#if&amp;gt;
    &amp;lt;/#list&amp;gt;
    &amp;lt;#return modified_date&amp;gt;
&amp;lt;/#function&amp;gt;
...

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;When I try to access docuents, I have this exception :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;exception_message : For "." left-hand operand: Expected a hash, but this has evaluated to a date_or_time_or_datetime (wrapper: f.t.SimpleDate):
==&amp;gt; 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]
----
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;How can I workaround this issue ?&lt;/P&gt;
&lt;P&gt;thanks a lot&lt;/P&gt;</description>
    <pubDate>Mon, 24 Oct 2022 08:07:30 GMT</pubDate>
    <dc:creator>freemann_</dc:creator>
    <dc:date>2022-10-24T08:07:30Z</dc:date>
    <item>
      <title>FreeMarker WebEngine - Expected a hash, but this has evaluated to a date_or_time_or_datetime</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/freemarker-webengine-expected-a-hash-but-this-has-evaluated-to-a/m-p/318337#M5338</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I try to migrate my LTS2019 webEngine app to LTS2021 and I have freemarker code problem .&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;...
&amp;lt;#function get_date doc modified_date
    &amp;lt;#list doc.children as child&amp;gt;
      &amp;lt;#if modified_date.time?datetime == child.dublincore.modified.time?datetime&amp;gt;
          &amp;lt;#local modified_date = child.dublincore.modified&amp;gt;
      &amp;lt;/#if&amp;gt;
      &amp;lt;#if doc.isFolder&amp;gt;
          &amp;lt;#local modified_date = get_date(child, modified_date)&amp;gt;
      &amp;lt;/#if&amp;gt;
    &amp;lt;/#list&amp;gt;
    &amp;lt;#return modified_date&amp;gt;
&amp;lt;/#function&amp;gt;
...

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;When I try to access docuents, I have this exception :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;exception_message : For "." left-hand operand: Expected a hash, but this has evaluated to a date_or_time_or_datetime (wrapper: f.t.SimpleDate):
==&amp;gt; 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]
----
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;How can I workaround this issue ?&lt;/P&gt;
&lt;P&gt;thanks a lot&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 08:07:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/freemarker-webengine-expected-a-hash-but-this-has-evaluated-to-a/m-p/318337#M5338</guid>
      <dc:creator>freemann_</dc:creator>
      <dc:date>2022-10-24T08:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: FreeMarker WebEngine - Expected a hash, but this has evaluated to a date_or_time_or_datetime</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/freemarker-webengine-expected-a-hash-but-this-has-evaluated-to-a/m-p/318338#M5339</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;When I try to display &lt;CODE&gt;child.dublincore.modified.time&lt;/CODE&gt;, I got the same error.
So I assume that in LTS2021, the is no more &lt;STRONG&gt;.time&lt;/STRONG&gt; attribut in modified date ?&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 12:40:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/freemarker-webengine-expected-a-hash-but-this-has-evaluated-to-a/m-p/318338#M5339</guid>
      <dc:creator>freemann_</dc:creator>
      <dc:date>2022-10-24T12:40:28Z</dc:date>
    </item>
  </channel>
</rss>

