Answers.Body: <p>As with any long established installation that has been through lots of updates, drilling down through the various symptoms lead down many alleys and dead ends. In the end it came down to a conflict with the Wordpress theme and the Gantry plugin it depended on. Rather than spending further time with providers support and patching, it was easier (!) to switch themes, and then reset and recreate the CiviCRM customised templates.</p>
  <p>This doc was helpful in testing using fresh installs and staging copies <a href="https://docs.civicrm.org/sysadmin/en/latest/misc/switch-servers/" rel="nofollow noreferrer">https://docs.civicrm.org/sysadmin/en/latest/misc/switch-servers/</a> In particular:</p>
  <ul>
  <li>checking the paths in civicrm.settings.php,</li>
  <li>deleting content of /wp-content/plugins/files/civicrm/templates_c/*,</li>
  <li>checking paths (or deleting) /wp-content/plugins/files/civicrm/ConfigAndLog/Config.IDS.ini</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-01-31T13:29:37.157Z
Answers.LastActivityDate: 2022-01-31T13:29:37.157Z
Answers.UserDisplayName: Eric Booth
Body: <p>Wordpress 5.8.3, shared server from SiteGround.</p>
  <p>We decided to upgrade from CiviCRM 5.35.2 to 5.45.1 in the hope of resolving an issue preventing supporter registration on website. I'm now stuck on some issues from the upgrade which may not be related to underlying issue but must be resolved first. Seems to be about templates and tokens but I've tried most suggestions I've found on StackExchange. There are also log entries dating back some time about <em>[warning] The system has data from both old+new conventions. Please use civicrm.settings.php to set civicrm.files explicitly.</em></p>
  <p>There were a bunch of warnings on completing the update script about changes to system templates. Taken copies of the modified text and html versions of the following before reverting to default and clearing out the templates_c folder  Contributions - Receipt (on-line); Contributions - Receipt (off-line); Memberships - Signup and Renewal Receipts (off-line); Memberships - Receipt (on-line).</p>
  <p>Civi admin opens OK and shortcode forms on web pages appear ok but the following actions bring errors:</p>
  <ol>
  <li>Opening the <strong>System Status</strong> page gives yellow error: <em>Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred.  call_user_func() expects parameter 1 to be a valid callback, class 'Closure' does not have a method 'onRegisterTokens'</em></li>
  <li>New Email from Contacts menu causes an out of memory error from Wordpress</li>
  <li>Message Templates are listed OK, and System Workflow Messages all show just the edit option meaning all using default, but click edit on any of the System or User-driven templates brings out of memory error.</li>
  </ol>
  <p>Tried turning on debug and using Directory Cleanup option &amp;directoryCleanup=3 which seems to successfully flush out the templates_c folder.</p>
  <p>I've tried changing civicrm.settings.php override
  // Override the custom templates directory.
  $civicrm_setting['Directory Preferences']['customTemplateDir'] = '/home/customer/www/xxx.org.uk/public_html/wp-content/uploads/civicrm/templates_c/';</p>
  <p>What else might I try?  Thanks!</p>
  
Tags: <wordpress><upgrade><tokens><message-templates>
Title: Out of memory and Civi errors relating to templates following upgrade from 5.35.2 to 5.45.1
ThreadText: # Out of memory and Civi errors relating to templates following upgrade from 5.35.2 to 5.45.1
  
  (Asked by: username_0 on 2022-01-21)
  
  Wordpress 5.8.3, shared server from SiteGround.
  
  We decided to upgrade from CiviCRM 5.35.2 to 5.45.1 in the hope of resolving an issue preventing supporter registration on website. I'm now stuck on some issues from the upgrade which may not be related to underlying issue but must be resolved first. Seems to be about templates and tokens but I've tried most suggestions I've found on StackExchange. There are also log entries dating back some time about *[warning] The system has data from both old+new conventions. Please use civicrm.settings.php to set civicrm.files explicitly.*
  
  There were a bunch of warnings on completing the update script about changes to system templates. Taken copies of the modified text and html versions of the following before reverting to default and clearing out the templates\_c folder Contributions - Receipt (on-line); Contributions - Receipt (off-line); Memberships - Signup and Renewal Receipts (off-line); Memberships - Receipt (on-line).
  
  Civi admin opens OK and shortcode forms on web pages appear ok but the following actions bring errors:
  
  1. Opening the **System Status** page gives yellow error: *Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred. call\_user\_func() expects parameter 1 to be a valid callback, class 'Closure' does not have a method 'onRegisterTokens'*
  2. New Email from Contacts menu causes an out of memory error from Wordpress
  3. Message Templates are listed OK, and System Workflow Messages all show just the edit option meaning all using default, but click edit on any of the System or User-driven templates brings out of memory error.
  
  Tried turning on debug and using Directory Cleanup option &directoryCleanup=3 which seems to successfully flush out the templates\_c folder.
  
  I've tried changing civicrm.settings.php override
  // Override the custom templates directory.
  $civicrm\_setting['Directory Preferences']['customTemplateDir'] = '/home/customer/www/xxx.org.uk/public\_html/wp-content/uploads/civicrm/templates\_c/';
  
  What else might I try? Thanks!
  
  **Tags:** wordpress, upgrade, tokens, message-templates
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2022-01-31. Score: 1
  
  As with any long established installation that has been through lots of updates, drilling down through the various symptoms lead down many alleys and dead ends. In the end it came down to a conflict with the Wordpress theme and the Gantry plugin it depended on. Rather than spending further time with providers support and patching, it was easier (!) to switch themes, and then reset and recreate the CiviCRM customised templates.
  
  This doc was helpful in testing using fresh installs and staging copies <https://docs.civicrm.org/sysadmin/en/latest/misc/switch-servers/> In particular:
  
  * checking the paths in civicrm.settings.php,
  * deleting content of /wp-content/plugins/files/civicrm/templates\_c/\*,
  * checking paths (or deleting) /wp-content/plugins/files/civicrm/ConfigAndLog/Config.IDS.ini
  
  
  ---
  
  