Answers.Body: <p>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.</p>
  <p>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 <a href="https://lab.civicrm.org/dev/core/-/issues/4951" rel="nofollow noreferrer">https://lab.civicrm.org/dev/core/-/issues/4951</a> as to which lines specifically cause problems</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-10-14T13:51:43.027Z
Answers.Text: The end of the line for CiviCRM under Windows has, I suspect, now been reached. The latest installation guide specifies Linux for the server.
Answers.UserDisplayName: Stephen Palmstrom
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-08T10:21:11.700Z
Answers.LastActivityDate: 2024-02-08T10:21:11.700Z
Answers.UserDisplayName: eileen
Answers.Body: <p>Changing <code>string:</code> to <code>eval:</code> on line 1040 in <code>&lt;drupal root&gt;\vendor\civicrm\civicrm-core\CRM\Utils\String.php</code> and making sure CIVICRM_CRED_KEYS started with aes-cbk rather than jwt-hs256 solved the problem.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-01-30T18:17:17.573Z
Answers.Text: 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.
Answers.UserDisplayName: Stephen Palmstrom
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-01-21T16:18:48.413Z
Answers.LastActivityDate: 2024-01-21T16:18:48.413Z
Answers.UserDisplayName: Stephen Palmstrom
Body: <p>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:</p>
  <pre><code>unable to write file &lt;Drupal Root&gt;\web\sites\default\files\civicrm\templates_c\en_GB\2e\76\18\2e76180b35db0da6edad2430223cfbf8b09021fc_0.string.string:{eval var=$smartySingleUseString|smarty:nodefaults}.php
  
  </code></pre>
  <p>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 &lt;Drupal root&gt;\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.</p>
  <p>So, is it time to move to Linux for all CiviCRM users?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-01-18T18:06:17.170Z
Comments.Text: Something similar was fixed at https://github.com/civicrm/civicrm-core/pull/28909. We just need to find where your line is. I'm thinking something to do with tokens.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-01-18T18:18:19.483Z
Comments.Text: If you change `fetch('string:` to `fetch('eval:` in this line does that fix it? https://github.com/civicrm/civicrm-core/blob/fbf738ed82313a0d6a3e5b873503244e82baf373/CRM/Utils/String.php#L1040
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-01-18T18:30:24.427Z
Comments.Text: 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
Comments.UserDisplayName: Stephen Palmstrom
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-01-18T18:40:57.547Z
Comments.Text: @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```
Comments.UserDisplayName: Stephen Palmstrom
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-01-18T18:44:26.047Z
Comments.Text: You might need to clear cache if you flip between smarty2 and smarty3? `cv flush`
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-01-20T13:09:42.840Z
Comments.Text: Replacing string: with eval: in  line 1040 of ```<Drupal root>\vendor\civicrm\civicrm-core\CRM\Utils\String.php``` solves the file rename issue, but instead we have an issue with missing tokens. We get errors like:
  ```Civi\Crypto\Exception\CryptoException: Failed to find key by ID or tag (z6BNl0_wDYQft0x4mbQidOEKlHk) in D:\CiviCRM_Custom.git\drupal8\vendor\civicrm\civicrm-core\Civi\Crypto\CryptoToken.php on line 143```
  
  The message seems to be missing a token.
  The message is being created in the send function of:
  
  ```<Drupal root\vendor\civicrm\civicrm-core\CRM\Utils\Mail.php```
Comments.UserDisplayName: Stephen Palmstrom
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-01-20T20:55:03.653Z
Comments.Text: Do you have both [SIGN_KEYS](https://docs.civicrm.org/sysadmin/en/latest/upgrade/version-specific/#signing-key) and [CRED_KEYS](https://docs.civicrm.org/sysadmin/en/latest/upgrade/version-specific/#civicrm-534) defined in civicrm.settings.php? If not, see [quick fix](https://docs.civicrm.org/sysadmin/en/latest/setup/secret-keys/#quick-setup).
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-01-21T16:00:31.993Z
Comments.Text: @Demerit Thanks, I had SIGN_KEYS and CRED_KEYS defined, but due to an earlier issue had them both starting with jwt, M when CRED_KEYS should have started with aes and sign keys with jwt. Making that correction solved the problem!
Comments.UserDisplayName: Stephen Palmstrom
Tags: <smarty><templates><windows>
Title: Is it the end of the road for CiviCRM under Windows?
ThreadText: # Is it the end of the road for CiviCRM under Windows?
  
  (Asked by: username_0 on 2024-01-18)
  
  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 \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 \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?
  
  **Tags:** smarty, templates, windows
  
  > **Comments:**
  > **username_1**: Something similar was fixed at https://github.com/civicrm/civicrm-core/pull/28909. We just need to find where your line is. I'm thinking something to do with tokens.  
  > **username_1**: If you change `fetch('string:` to `fetch('eval:` in this line does that fix it? https://github.com/civicrm/civicrm-core/blob/fbf738ed82313a0d6a3e5b873503244e82baf373/CRM/Utils/String.php#L1040  
  > **username_0**: 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  
  > **username_0**: @username_1 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```  
  > **username_1**: You might need to clear cache if you flip between smarty2 and smarty3? `cv flush`  
  > **username_0**: Replacing string: with eval: in  line 1040 of ```<Drupal root>\vendor\civicrm\civicrm-core\CRM\Utils\String.php``` solves the file rename issue, but instead we have an issue with missing tokens. We get errors like: ```Civi\Crypto\Exception\CryptoException: Failed to find key by ID or tag (z6BNl0_wDYQft0x4mbQidOEKlHk) in D:\CiviCRM_Custom.git\drupal8\vendor\civicrm\civicrm-core\Civi\Crypto\CryptoToken.php on line 143```  The message seems to be missing a token. The message is being created in the send function of:  ```<Drupal root\vendor\civicrm\civicrm-core\CRM\Utils\Mail.php```  
  > **username_1**: Do you have both [SIGN_KEYS](https://docs.civicrm.org/sysadmin/en/latest/upgrade/version-specific/#signing-key) and [CRED_KEYS](https://docs.civicrm.org/sysadmin/en/latest/upgrade/version-specific/#civicrm-534) defined in civicrm.settings.php? If not, see [quick fix](https://docs.civicrm.org/sysadmin/en/latest/setup/secret-keys/#quick-setup).  
  > **username_0**: @username_1 Thanks, I had SIGN_KEYS and CRED_KEYS defined, but due to an earlier issue had them both starting with jwt, M when CRED_KEYS should have started with aes and sign keys with jwt. Making that correction solved the problem!  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2024-02-08. Score: 1
  
  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
  
  > **Comments:**
  > **username_0**: The end of the line for CiviCRM under Windows has, I suspect, now been reached. The latest installation guide specifies Linux for the server.  
  
  ---
  
  ### Answer by username_0 on 2024-01-21. Score: 1
  
  Changing `string:` to `eval:` on line 1040 in `\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.
  
  > **Comments:**
  > **username_0**: 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.  
  
  ---
  
  