Running latest CiviCRM on latest Drupal 7, php 7.4.28. This error was reported by one of our volunteers when trying to edit a contact yesterday. Logged in as Admin I can replicate on any contact, and have confirmed that our testing version of the site does exactly the same. Having checked recent records added to the contacts table, disabled all extensions, cleared caches, etc. the problem does not go away. I've rolled back to 5.47.0, which was the previous version we were running and it is on there too, so I'm not sure when this issue first appeared (small organisation and it is very possible that this was simply not noticed by our volunteers - I don't regularly use the system myself except to change settings.)
I'm also seeing the same message in an alert from time to time, for example I just got it when loading the Dashboard.
Enabling debugging and backtrace, then looking in the logs, I get this, but am unclear what it is telling me or where to go next [server path redacted]. Any suggestions?
Mar 24 07:14:13 [error]
$Fatal Error Details = array:3 [
"message" => "Malformed token parameters ({contact.first_name|truncate:1:"":true})"
"code" => null
"exception" => CRM_Core_Exception {#1862
-errorData: array:1 [
"error_code" => 0
]
#cause: null
-_trace: null
#message: "Malformed token parameters ({contact.first_name|truncate:1:"":true})"
#code: 0
#file: "/[myserverpath]/public/sites/all/modules/civicrm/Civi/Token/TokenProcessor.php"
#line: 444
trace: {
/[myserverpath]/public/sites/all/modules/civicrm/Civi/Token/TokenProcessor.php:444 {
› if ($unmatched) {
› throw new \CRM_Core_Exception('Malformed token parameters (' . $m[0] . ')');
› }
}
Civi\Token\TokenProcessor->Civi\Token\{closure}() {}
/[myserverpath]/public/sites/all/modules/civicrm/Civi/Token/TokenProcessor.php:431 { …}
/[myserverpath]/public/sites/all/modules/civicrm/Civi/Token/TokenProcessor.php:156 { …}
/[myserverpath]/public/sites/all/modules/civicrm/CRM/Core/TokenSmarty.php:56 { …}
/[myserverpath]/public/sites/all/modules/civicrm/CRM/Contact/Form/Edit/CommunicationPreferences.php:95 { …}
/[myserverpath]/public/sites/all/modules/civicrm/CRM/Contact/Form/Contact.php:804 { …}
/[myserverpath]/public/sites/all/modules/civicrm/CRM/Core/Form.php:689 { …}
/[myserverpath]/public/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php:76 { …}
/[myserverpath]/public/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php:203 { …}
/[myserverpath]/public/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php:103 { …}
/[myserverpath]/public/sites/all/modules/civicrm/CRM/Core/Controller.php:355 { …}
/[myserverpath]/public/sites/all/modules/civicrm/CRM/Utils/Wrapper.php:98 { …}
/[myserverpath]/public/sites/all/modules/civicrm/CRM/Core/Invoke.php:292 { …}
/[myserverpath]/public/sites/all/modules/civicrm/CRM/Core/Invoke.php:69 { …}
/[myserverpath]/public/sites/all/modules/civicrm/CRM/Core/Invoke.php:36 { …}
/[myserverpath]/public/sites/all/modules/civicrm/drupal/civicrm.module:471 { …}
/[myserverpath]/public/includes/menu.inc:527 { …}
/[myserverpath]/public/index.php:21 { …}
}
}
]
Mar 24 07:14:13 [debug] $backTrace = #0 /[myserverpath]/public/sites/all/modules/civicrm/CRM/Core/Error.php(433): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /[myserverpath]/public/sites/all/modules/civicrm/CRM/Core/Invoke.php(39): CRM_Core_Error::handleUnhandledException(Object(CRM_Core_Exception))
#2 /[myserverpath]/public/sites/all/modules/civicrm/drupal/civicrm.module(471): CRM_Core_Invoke::invoke((Array:3))
#3 /[myserverpath]/public/includes/menu.inc(527): civicrm_invoke("contact", "add")
#4 /[myserverpath]/public/index.php(21): menu_execute_active_handler()
#5 {main}
Thanks, Steve