I carry out the following steps:

  • Perform an Advanced Search displaying as contributions
  • Select one or more contributions
  • From the actions menu select Receipts - print or email

No matter how many contributions are selected, on the Print Contribution Receipts screen it always says Number of selected contributions: 1 and the receipt that is emailed or displayed as a pdf is always for contribution_id = 101.

If, instead, I access the action Receipts - print or email through the Find Contributions search everything works as it should, ie. I get the appropriate receipt(s) emailed or displayed as a pdf.

All other actions work correctly whether I start from Advanced Search displaying as Contributions or Find Contributions.

I have enabled Debugging on our dev site (same problem exists on both live and dev sites) and compared the assigned template variables for both of the print receipts screens. There are differences in:

  • {$action} - which is to be expected. (It is "512" when I start from Advanced Search and "1" when I start from Find Contribution)
  • {$single}, {$totalSelectedContributions} and {$taskName} as shown below:

For the process that works the assigned template variables are: FindContributionsReceiptPrintOrEmail

For the process that doesn't work the assigned template variables are: AdvancedSearchReceiptPrintOrEmail

To me it sort of seems like something has become hard-coded somewhere (but only for the Receipts - print or email action). I thought I could compare the code from our site with the code from the CiviCRM repository but I am not sure what file(s) to look at. Can anyone point me in the right direction?

(For completeness, our site is CiviCRM 4.7.27 running on Drupal 7. I have absolutely no idea when this problem started.)

Update: SO far I have found no differences between the code on our site and on the civicrm-core 4.27 branch for:

  • /CRM/Contact/Form/Search/Advanced.php
  • /CRM/Contact/Form/Search/Basic.php
  • /CRM/Contribute/Task.php
  • /CRM/Contribute/StateMachine/Search.php
  • /CRM/Contribute/StateMachine/ContributionPage.php
  • /CRM/Contribute/StateMachine/Contribution.php
  • /CRM/Contribute/Selector/Search.php
  • /CRM/Contribute/Form/Search.php
  • I couldn't replicate it on fresh install of 4.7.29. Can try after upgrading CiviCRM to 4.7.29 if the error still persists? Jan 12 '18 at 7:28

Your Answer

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

Browse other questions tagged or ask your own question.