Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-17519

CRM_Core_Payment_BaseIPN::completeTransaction() should clear the Smarty template

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.6.3
    • Fix Version/s: None
    • Component/s: CiviContribute
    • Labels:
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code

      Description

      There are occasions when CRM_Core_Payment_BaseIPN::completeTransaction() is called multiple times in the same request (in my case it is processing recurring payments using the Ewayrecurring payment processor).

      When the processor runs for mulitple payments the receipts are written using a Smarty template, but the Smarty TPL variables aren't cleared before each receipt, so details from one receipt can spill over into the next.

      The following code needs to be inserted before the call to self::SendMail() ...

          $template = CRM_Core_Smarty::singleton();
          $template->clearTemplateVars();
      

      Note: the deprecated function CRM_Core_Payment_BaseIPN::updateContributionStatus() did this, so I assume it's appropriate here.

      I can supply a PR, but perhaps someone can advise if this is the right approach?

        Attachments

          Activity

            People

            • Assignee:
              eileen Eileen McNaughton
              Reporter:
              ken Ken West
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: