Upgrade to Smarty5
Now that we have upgraded many sites to Smarty3 Smarty5 is on the cusp of being release....
See related issue #4954 (closed) on getting to Smarty4
The upgrade from Smarty 3 or 4 to Smarty 5 has some minor challenges.
https://smarty-php.github.io/smarty/5.x/upgrading/
- assign_by_ref needs to be replaced with assign wherever it appears (yay I've been wanting to get rid of those)
- some php-language modifiers will stop working without intervention (not sure how affected we are but if some are common it is easy to 'make them work')
- before we can see / address the above there is a problem with our Smarty compatibility class. Our Smarty class has functions like
getTemplateVars()
to allow sites still on Smarty2 to call the v3 functions. That particular function has a different signature in Smarty5 so overriding it causes fatals
Proposal
- Check Smarty5 into packages like Smarty4 - see https://github.com/civicrm/civicrm-packages/pull/380
- the path fix in Smarty4 will allow easy switch to Smarty5 for developers
- Move
getTemplateVars()
& any other functions in the same boat from being on our Smarty compatibility class to being 'hacked onto' the Smarty 2 code in our packages folder. - replace assign-by-ref with assign
- That should be enough to get us to the point where we can get dev sites to load and from there we can figure out if we have to scale a mountain or a molehill to move to Smarty5 instead of 3 or 4 when we do our force change