Event registration crashes under Windows - is this a Smarty3 issue?
Overview
I raised this in Stackexchange and have had some feedback (Is this the end of the road for CiviCRM under Windows?)
Reproduction steps
- Create an event.
- Fill in details for two people and click Review.
- Click Register.
- Got a cannot write file error:
SmartyException: "unable to write file <Drupal root>\web\sites\default\files\civicrm\templates_c\en_GB\c3\0d\eb\c30deb6712dca60a591491c1b9b34a88872d619f_0.string.{eval var=$smartySingleUseString|smarty:nodefaults}.php"
- After replacing string: with eval: in line 1040 of ```\vendor\civicrm\civicrm-core\CRM\Utils\String.php`` got
Civi\Crypto\Exception\CryptoException: Failed to find key by ID or tag (z6BNl0_wDYQft0x4mbQidOEKlHk) in <Drupal root>\vendor\civicrm\civicrm-core\Civi\Crypto\CryptoToken.php on line 143
Current behaviour
See above. The file write error is because Windows doesn't support colons and other unusual characters in file names.
Expected behaviour
Registration should be successful.
Environment information
- Browser: IIS but probably not relevant.
- CiviCRM: 5.71.Alpha1 but also seen in 5.69.2 The issue in the latter is stopping us updating our live environment.
- PHP: _8.3.1__
- CMS: Drupal 10.2.2
- Database: MySQL 8.0
- Web Server: IIS 10
Comments
Smarty is clearly intended to support Windows as there are references to it in the code. It looks as though the syntax for smartySingleUseString requires file names that are incompatible with running under Windows, or maybe I have misunderstood something. My knowledge of the mail system doesn't readily lend itself to discovering where the encryption keys or tags should be found, but maybe somebody reading this has a better knowledge than I.
I have not cluttered the issue with the long stack traces.