The error started happening when we added an 'if' clause to the greeting template and disappeared when we removed it again.
It appeared to be maybe a memory leak?
It's worth investigating because it might point to performance issues that affect us more broadly with smarty parsing (eg. in Thank you mails).
Here is the reason why the 'if' punches above it's weight
Note the reason the single-use string turns off smarty caching is the strings aren't cachable - ie you wind up with {if 1}Dear Greg{else}Dear donor} as the string
public static function parseOneOffStringThroughSmarty($templateString) { if (!CRM_Utils_String::stringContainsTokens($templateString)) { // Skip expensive smarty processing. return $templateString; }
ie - no if & smarty doesn't load. We initially testing adding the if & didn't see a big performance hit - but today's issue suggests more of a memory leak - which builds up rather than an instant hit
Note the caching is turned off in that function because single-use strings aren't cachable - ie at that point the string looks like
`{if 1}Dear Elliot{else}Dear donor{/if}