NonStringException coming.
Hi
Iam showing notifcation for user. On stage environment its working fine but when I went on production its showing following exception:
NonStringException:For "?length" left-hand operand: Expected a string or something automatically convertible to string (number, date or boolean), but this evaluated to a sequence+hash (wrapper: f.e.dom.NodeListModel):
==> string [in template "pdc6_helpers.ftl" at line 77, column 12]
The failing instruction (print stack trace for 6 more):
==> #if (string?length < limit?number) [in template "pdc6_helpers.ftl" in function "truncateMaybe" at line 77, column 5]
I saw there is error on "pdc6_helpers.ftl" in function "truncateMaybe" at line 77. I have written following code:
<#function truncateMaybe string, append = '...'>
<#if ( string?length < 30 ) >
<#return string>
<#else>
<#return string?substring( 0, 30 ) + append>
</#if>
</#function>
As per my consideration i think some attribute is coming null thats why it is appearing.
I think "string?has_content" content can solve this but for my case its not working.
Following is the code where iam showing notification.
<#assign subject = truncateMaybe(notification.target.entity.subject) />