Undefined index: contribution in CRM_Contribute_BAO_Contribution::getContributionTokenValues()
Overview
After sending thank-you emails/letters for contributions, generates an error, for each contribution thank you generated: Notice: Undefined index: contribution in CRM_Contribute_BAO_Contribution::getContributionTokenValues() ... Warning: array_search() expects parameter 2 to be array, null given in CRM_Contribute_BAO_Contribution::getContributionTokenValues()
Using CiviCRM 5.36.1 | Drupal 7.80
Reproduction steps
- Contributions -> Find Contributions -> Search
- Select contributions without "Thank-you Sent" (Error occurs whether one or more contacts/contributions selected.
- Select Actions -> Thank-you letters print or email"
- Error occurs regardless of "group contributions by", "Print and email options" settings
- Use template (error occurs regardless of template selection)
- Click "Make Thank-you Letters" button
Current behaviour
If the Print and email options mean a PDF is generated (i.e. Print PDF, Send emails where possible generate pdfs where no email possible, Send emails and generate pdf etc) then a pdf is downloaded and emails are sent. The error message appears the next time a page is loaded (i.e after clicking "done"). Message that thank you letters sent.
If no pdfs are generated, but emails are sent. Emails are sent. Message that thank you letters are sent, but also error message.
Error message only. The functionality is okay.
Notice: Undefined index: contribution in CRM_Contribute_BAO_Contribution::getContributionTokenValues() (line 5293 of /bitnami/drupal/modules/contrib/civicrm/CRM/Contribute/BAO/Contribution.php).
Warning: array_search() expects parameter 2 to be array, null given in CRM_Contribute_BAO_Contribution::getContributionTokenValues() (line 5293 of /bitnami/drupal/modules/contrib/civicrm/CRM/Contribute/BAO/Contribution.php).
Expected behaviour
No error information
Environment information
- CiviCRM: 5.36.1
- PHP: 7.3.27
- CMS: Drupal 7.78 and 7.80
- Database: _MySQL 5.7.33
- Web Server: _Apache 2.4.46