Fix PayPal Express on events
authorJon Goldberg <jon@megaphonetech.com>
Thu, 5 Mar 2020 22:24:16 +0000 (17:24 -0500)
committerJon Goldberg <jon@megaphonetech.com>
Thu, 5 Mar 2020 22:24:16 +0000 (17:24 -0500)
CRM/Core/Form.php

index c8b1d2b8add96551a709eab91622fad5c1c6c36a..17145046054453ef8c3b657edc52b6f6fc9213c2 100644 (file)
@@ -929,7 +929,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
   protected function handlePreApproval(&$params) {
     try {
       $payment = Civi\Payment\System::singleton()->getByProcessor($this->_paymentProcessor);
-      $params['component'] = 'contribute';
+      $params['component'] = $params['component'] ?? 'contribute';
       $result = $payment->doPreApproval($params);
       if (empty($result)) {
         // This could happen, for example, when paypal looks at the button value & decides it is not paypal express.