Don't clobber contributionRecur currency on edit
authorElliott Eggleston <ejegg@ejegg.com>
Mon, 8 Aug 2016 18:20:48 +0000 (14:20 -0400)
committerElliott Eggleston <ejegg@ejegg.com>
Mon, 8 Aug 2016 18:20:48 +0000 (14:20 -0400)
When editing an existing contribution_recur without specifying a
currency, do not change the record to the default currency.

CRM/Contribute/BAO/ContributionRecur.php

index 0159fbbc836f6dba0be5f3ab5ab069be18190db0..99c49a2f5a70b88728ba41b18142d6e0d457b48f 100644 (file)
@@ -85,7 +85,7 @@ class CRM_Contribute_BAO_ContributionRecur extends CRM_Contribute_DAO_Contributi
     $recurring->id = CRM_Utils_Array::value('id', $params);
 
     // set currency for CRM-1496
-    if (!isset($recurring->currency)) {
+    if (empty($params['id']) && !isset($recurring->currency)) {
       $config = CRM_Core_Config::singleton();
       $recurring->currency = $config->defaultCurrency;
     }