0

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

1 Answer 1

2

Have you customised the greetings or addressee formats? Go to Administer > Communications > Email Greeting Formats, Postal Greeting Formats, Addressee Formats and compare your values with those on https://dmaster.demo.civicrm.org

3
  • 1
    Thanks Aiden - you are right, there was an extra entry in Addressee formats. One place I'd not looked as I knew I'd never changed anything on that screen. Deleted it and all is well again. Wonder how that got there, is there any way for me to find out? Mar 24, 2022 at 17:35
  • The options are stored in the civicrm_option_value table so if you're using extended logging you could see what log_civicrm_option_value tells you.
    – Aidan
    Mar 25, 2022 at 14:22
  • Fascinating - that entry has been in the database since 2015, not long after we set the system up, and never caused a problem before! Goodness knows why it was added, but it was my account that did it, though I have absolutely no recollection of it. Some random bit of advice from somewhere while I was finding my feet. Thanks again Mar 25, 2022 at 21:40

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.