<?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 Re: 5.1 FreeMarker template error: The following has evaluated to null or missing: in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/5-1-freemarker-template-error-the-following-has-evaluated-to/m-p/23344#M10199</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I actually meant "pretty clear" because the message states that as the failing instruction. Most other error stacktraces won't show any detail that comes even close to this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ugh - these activities templates are a mess. I am glad I never had to look too closely at them. Inside of an &amp;amp;lt;#assign&amp;amp;gt; section things do indeed become tricky when you use interpolation instead of simple string concatenation. As far as I can tell - yes, you should add the expression I provided with encoded double quotes in that case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These email templates are initialised when the tenant is first created with the email templates that Alfresco provides at that point. After initialisation, each template in each tenant may be individually modified / updated. From my experience Alfresco typically neglects the multi-tenant use case, and new versions of Alfresco may only provide patches to update the templates in the default tenant but not any other tenants.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to avoid similar issues in other expressions the pattern should probably changed in all occurrences you can find. Though the pattern itself is likely not the immediate cause of the issue - the fact that the "page" attribute in that data structure has not been provided for at least on activity is the cause. Alfresco never really expected that or tested against that, which is why they have not realised the patterns are not able to deal with such a situation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Mar 2017 09:05:07 GMT</pubDate>
    <dc:creator>afaust</dc:creator>
    <dc:date>2017-03-22T09:05:07Z</dc:date>
    <item>
      <title>5.1 FreeMarker template error: The following has evaluated to null or missing:</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/5-1-freemarker-template-error-the-following-has-evaluated-to/m-p/23341#M10196</link>
      <description>UPDATE:1. Without changing anything at all, nor restarting any process, the emails were delivered last night successfully... We are both happy and concerned simultaneously.2. The system was actually built 2+ years ago (Jan 2015) using Linux all in one installer for version 5.0.x, then the tomcat dir</description>
      <pubDate>Tue, 21 Mar 2017 00:11:54 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/5-1-freemarker-template-error-the-following-has-evaluated-to/m-p/23341#M10196</guid>
      <dc:creator>briant</dc:creator>
      <dc:date>2017-03-21T00:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: 5.1 FreeMarker template error: The following has evaluated to null or missing:</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/5-1-freemarker-template-error-the-following-has-evaluated-to/m-p/23342#M10197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The error is pretty clear in the message:&lt;/P&gt;&lt;P&gt;${activity.activitySummary.page?html!""} [in template "workspace://SpacesStore/5068a46c-83b8-4377-8f77-3a669183e5d9" at line 53, column 128]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That means the data model prepared for the activity that is to be included in an email is incomplete and does not contain a "page" property. Interestingly, the expression already contains a "!" operator to fallback to an empty string if there is no data - but it is placed in the wrong place. The expression should be ${(activity.activitySummary.page!"")?html}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can correct it by editing the template document specified by the NodeRef.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Mar 2017 15:23:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/5-1-freemarker-template-error-the-following-has-evaluated-to/m-p/23342#M10197</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2017-03-21T15:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: 5.1 FreeMarker template error: The following has evaluated to null or missing:</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/5-1-freemarker-template-error-the-following-has-evaluated-to/m-p/23343#M10198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Axel Faust wrote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error is pretty clear in the message:&lt;/P&gt;&lt;P&gt;${activity.activitySummary.page?html!""} [in template "workspace://SpacesStore/5068a46c-83b8-4377-8f77-3a669183e5d9" at line 53, column 128]&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;It's only "pretty clear" if you &lt;EM&gt;know&lt;/EM&gt; what the expression &lt;EM&gt;should&lt;/EM&gt; be &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt; Experience is a wonderful thing after you have it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Checking the other language email templates in the tenant instance all reveal they have identical line 53's, sample from activities-email_de.ftl in the tenant:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&amp;lt;#assign itemLink="&amp;lt;a href=\"${shareUrl}/page/site/${activity.siteNetwork?html}/${activity.activitySummary.page?html!\"\"}\"&amp;gt;${activity.activitySummary.title?html!\"\"}&amp;lt;/a&amp;gt;"&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;B&gt;Axel Faust&lt;/B&gt;‌: Do the double quotes need escaping?&lt;/P&gt;&lt;P&gt;ie: you said it needs to be: ${(activity.activitySummary.page!"")?html}&lt;/P&gt;&lt;P&gt;Should it be entered verbatim like this:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&amp;lt;#assign itemLink="&amp;lt;a href=\"${shareUrl}/page/site/${activity.siteNetwork?html}/$&lt;STRONG&gt;{(activity.activitySummary.page!"")?html}&lt;/STRONG&gt;\"&amp;gt;${activity.activitySummary.title?html!\"\"}&amp;lt;/a&amp;gt;"&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;...or like this with \"\" ?&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&amp;lt;#assign itemLink="&amp;lt;a href=\"${shareUrl}/page/site/${activity.siteNetwork?html}/$&lt;STRONG&gt;{(activity.activitySummary.page!\"\")?html}&lt;/STRONG&gt;\"&amp;gt;${activity.activitySummary.title?html!\"\"}&amp;lt;/a&amp;gt;"&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Hmm - It seems the primary (non-tenant) instance is different? This file was created at install time on 19/Jan/2015, over two years ago. We would expect the tenant versions to be identical, no?&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&amp;lt;#assign itemLink="&amp;lt;a href=\"${shareUrl}/page/site/${activity.siteNetwork?html}/$&lt;STRONG&gt;{activity.activitySummary.page!\"\"}&lt;/STRONG&gt;\"&amp;gt;${activity.activitySummary.title!\"\"}&amp;lt;/a&amp;gt;"&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Does the primary non-tenant need the () and ?html appended per your example?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We also note that a similar pattern appears several times in these templates - do we need to change them all?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We really need these emails to be delivered.&lt;/P&gt;&lt;P&gt;Many thanks in advance for your help and advice.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Mar 2017 01:40:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/5-1-freemarker-template-error-the-following-has-evaluated-to/m-p/23343#M10198</guid>
      <dc:creator>briant</dc:creator>
      <dc:date>2017-03-22T01:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: 5.1 FreeMarker template error: The following has evaluated to null or missing:</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/5-1-freemarker-template-error-the-following-has-evaluated-to/m-p/23344#M10199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I actually meant "pretty clear" because the message states that as the failing instruction. Most other error stacktraces won't show any detail that comes even close to this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ugh - these activities templates are a mess. I am glad I never had to look too closely at them. Inside of an &amp;amp;lt;#assign&amp;amp;gt; section things do indeed become tricky when you use interpolation instead of simple string concatenation. As far as I can tell - yes, you should add the expression I provided with encoded double quotes in that case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These email templates are initialised when the tenant is first created with the email templates that Alfresco provides at that point. After initialisation, each template in each tenant may be individually modified / updated. From my experience Alfresco typically neglects the multi-tenant use case, and new versions of Alfresco may only provide patches to update the templates in the default tenant but not any other tenants.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to avoid similar issues in other expressions the pattern should probably changed in all occurrences you can find. Though the pattern itself is likely not the immediate cause of the issue - the fact that the "page" attribute in that data structure has not been provided for at least on activity is the cause. Alfresco never really expected that or tested against that, which is why they have not realised the patterns are not able to deal with such a situation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Mar 2017 09:05:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/5-1-freemarker-template-error-the-following-has-evaluated-to/m-p/23344#M10199</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2017-03-22T09:05:07Z</dc:date>
    </item>
  </channel>
</rss>

