CRM-20469 Event form currency is in a slightly different spot
authoradixon <alan.g.dixon@gmail.com>
Mon, 24 Apr 2017 20:46:57 +0000 (16:46 -0400)
committeradixon <alan.g.dixon@gmail.com>
Mon, 24 Apr 2017 20:46:57 +0000 (16:46 -0400)
CRM/Core/Payment/ProcessorForm.php

index 1cab78655c2a4117ef3d629cc6e356be40461450..720dae52253b2507f3488a91277fa1cf343183fa 100644 (file)
@@ -72,7 +72,12 @@ class CRM_Core_Payment_ProcessorForm {
 
     $form->assign('suppressSubmitButton', $form->_paymentObject->isSuppressSubmitButtons());
 
-    $form->assign('currency', CRM_Utils_Array::value('currency', $form->_values));
+    $currency = CRM_Utils_Array::value('currency', $form->_values);
+    // For event forms, currency is in a different spot
+    if (empty($currency)) {
+      $currency = CRM_Utils_Array::value('currency', $form->_values['event']);
+    }
+    $form->assign('currency', $currency);
 
     // also set cancel subscription url
     if (!empty($form->_paymentProcessor['is_recur']) && !empty($form->_values['is_recur'])) {