-
Notifications
You must be signed in to change notification settings - Fork 46
Description
ChatGPT helped me with formulating this issue report, so I am not nearly as smart as it sounds...
I'm running CiviCRM 6.2 on Ubuntu 20.04 with PHP 8.1 and on Debian Bookworm with PHP 8.2 and encountered a Smarty 5 compatibility issue when attempting to create a new SEPA mandate via the CiviSEPA extension.
When I try to create a mandate for a contact, I get the following error:
Smarty\CompilerException: "Syntax error in template "file:CRM/common/jcalendar.tpl" on line 41
"{assign var='displayDate' value=$elementId|cat:"_display"|cat:"_$string"|uniqid}"
unknown modifier 'uniqid'"
This happens because uniqid is being used as a Smarty modifier, but Smarty 5 doesn't recognize it by default, and it hasn't been registered as a custom plugin. This breaks rendering of the form used to create SEPA mandates.
Environment:
- CiviCRM 6.2
- org.project60.sepa (latest as of May 2025)
- PHP 8.1/8.2
- Standalone installation, Also WordPress Plugin
Suggestion:
To fix this, either:
- Replace the use of |uniqid with a method that conforms to Smarty 5 syntax, e.g. generate uniqid() in PHP and pass it to the template
- Or refactor the line in jcalendar.tpl like this (pseudocode):
{assign var="uniqid" value=$php.uniqid()}
{assign var='displayDate' value=$elementId|cat:"_display"|cat:"_$string"|cat:$uniqid}
But ideally, remove usage of unsupported Smarty modifiers entirely for forward compatibility with Smarty 5.
Let me know if you'd like me to test a patch. Thanks for maintaining this excellent extension!