I'm creating a custom thank you following the instructions here


However the {contribution.total_amount} token is causing an error saying

Invalid currency "USD****~~~~USD****~~~~USD****~~~~USD****~~~~USD"

All of my contributions are in dollars and that's what I've also set in localization.

What could be causing this?

This only happens when using the grouping option. I'm wondering if it relates to https://github.com/civicrm/civicrm-core/blob/3bfdcfb534a0b27a4f7f4c65bb07f2670ac31d14/CRM/Contribute/Form/Task/PDFLetterCommon.php#L74

CiviCRM 5.32.2
Joomla 3.9.23

  • That's a very strange currency. To find where it's coming from you could try adding some debugging in here to print a stack trace and what the input params are.
    – Demerit
    Jan 4 at 15:27
  • I'll tell you what's interesting, if I don't group the contributions it doesn't happen.
    – Elin
    Jan 4 at 22:48
  • So if I change that "placeholder separator" to "" I get USDUSDUSDUSD ... so somehow it is not doing the replacements I guess.
    – Elin
    Jan 5 at 21:41
  • This code comment might be old, but maybe the feature was never fully completed: github.com/civicrm/civicrm-core/blob/…
    – Demerit
    Jan 5 at 21:56
  • 1
    Was able to reproduce this error in both Drupal and wpmasters demo sites. This seems to be something quite recent as I was able to create this letter on Drupal and WP on early versions (tried on 5.31.0 and earlier and it worked fine) however on 5.32.2 (and possibly even earlier) it has been showing this error..
    – netzih
    Jan 21 at 23:08

This was a regression and was fixed. https://lab.civicrm.org/dev/core/-/issues/2344

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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