We run CiviCRM under Drupal and Windows/IIS. Having upgraded our test environment to 5.69.2, we found we could not register for events, as we got errors along the lines of:

unable to write file <Drupal Root>\web\sites\default\files\civicrm\templates_c\en_GB\2e\76\18\2e76180b35db0da6edad2430223cfbf8b09021fc_0.string.string:{eval var=$smartySingleUseString|smarty:nodefaults}.php

This is, I believe, due to characters such as : being illegal under Windows. I've been trying to discover where the file name is being generated. Using a regular expression to tidy up the file name before attempting to create it (rename a temporary file) around line 69 of <Drupal root>\vendor\civicrm\civicrm-packages\smarty3\vendor\smarty\smarty\libs\sysplugins\smarty_internal_runtime_writefile.php just gave other errors. I see the same issue when running a development environment under 5.71.alpha1.

So, is it time to move to Linux for all CiviCRM users?

  • Something similar was fixed at github.com/civicrm/civicrm-core/pull/28909. We just need to find where your line is. I'm thinking something to do with tokens.
    – Demerit
    Commented Jan 18 at 18:06
  • If you change fetch('string: to fetch('eval: in this line does that fix it? github.com/civicrm/civicrm-core/blob/…
    – Demerit
    Commented Jan 18 at 18:18
  • I tried turning off Smarty3 in civicrm_settings.php, and got an error along the lines of: 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 Commented Jan 18 at 18:30
  • @Demerit I tried changing fetch('string to fetch('eval as suggested in <drupal root>\vendor\civicrm\civicrm-core\CRM\Utils\String.php line 1040 and 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 Commented Jan 18 at 18:40
  • You might need to clear cache if you flip between smarty2 and smarty3? cv flush
    – Demerit
    Commented Jan 18 at 18:44

2 Answers 2


Changing string: to eval: on line 1040 in <drupal root>\vendor\civicrm\civicrm-core\CRM\Utils\String.php and making sure CIVICRM_CRED_KEYS started with aes-cbk rather than jwt-hs256 solved the problem.

  • I am still getting errors when trying to register for an event. Fortunately on a test system., errors like: TypeError: Unsupported operand types: float + string in content_65b92792401997_13080208() (line 408 of D:\CiviCRM_Custom.git\drupal_test\vendor\civicrm\civicrm-packages\smarty3\vendor\smarty\smarty\libs\sysplugins\smarty_resource_recompiled.php(52) : eval()'d code). I've tried debugging, but has anyone got a suggestion as to how you can discover the content? This has meant that we can't update our production environment and are considering moving off Windows. Commented Jan 30 at 18:17

Just noting that this is patched in the latest CiviCRM release (5.69.5+) by @demerit with the fix he suggested above. In addition there was a separate issue relating to the text version of the offline event template - we now ship 5.69.5 with a blank text version of the offline event template and we have removed almost all the text versions in 5.70 - if there is no blank version a text version is generated at the point of send from the rendered html.

However, people who have customised the text version will not automatically have their customised version updated - if you want to manually update rather than delete your text version there is discussion on the gitlab https://lab.civicrm.org/dev/core/-/issues/4951 as to which lines specifically cause problems

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.