Fix button breakage on viewContribution
authorEileen McNaughton <emcnaughton@wikimedia.org>
Thu, 14 Apr 2022 06:20:08 +0000 (18:20 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 20 Apr 2022 01:16:29 +0000 (13:16 +1200)
CRM/Contribute/BAO/Contribution.php
CRM/Contribute/Form/ContributionView.php
templates/CRM/Contribute/Form/PaymentInfoBlock.tpl

index 96637af02da072ec7f92c4460aef4a190c123c6d..0813283626bfbf24cfb80d4b156044e9fb58ccfb 100644 (file)
@@ -4271,50 +4271,50 @@ LIMIT 1;";
     }
     $actionLinks = [];
     $actionLinks[] = [
-      'url' => CRM_Utils_System::url('civicrm/payment', [
-        'action' => 'add',
-        'reset' => 1,
-        'id' => $id,
-        'is_refund' => 0,
-      ]),
+      'url' => 'civicrm/payment',
       'title' => ts('Record Payment'),
       'accessKey' => '',
       'ref' => '',
       'name' => '',
-      'qs' => '',
+      'qs' => [
+        'action' => 'add',
+        'reset' => 1,
+        'id' => $id,
+        'is_refund' => 0,
+      ],
       'extra' => '',
     ];
 
     if (CRM_Core_Config::isEnabledBackOfficeCreditCardPayments()) {
       $actionLinks[] = [
-        'url' => CRM_Utils_System::url('civicrm/payment', [
+        'url' => 'civicrm/payment',
+        'title' => ts('Submit Credit Card payment'),
+        'accessKey' => '',
+        'ref' => '',
+        'name' => '',
+        'qs' => [
           'action' => 'add',
           'reset' => 1,
           'is_refund' => 0,
           'id' => $id,
           'mode' => 'live',
-        ]),
-        'title' => ts('Submit Credit Card payment'),
-        'accessKey' => '',
-        'ref' => '',
-        'name' => '',
-        'qs' => '',
+        ],
         'extra' => '',
       ];
     }
     if ($contributionStatus !== 'Pending') {
       $actionLinks[] = [
-        'url' => CRM_Utils_System::url('civicrm/payment', [
-          'action' => 'add',
-          'reset' => 1,
-          'id' => $id,
-          'is_refund' => 1,
-        ]),
+        'url' => 'civicrm/payment',
         'title' => ts('Record Refund'),
         'accessKey' => '',
         'ref' => '',
         'name' => '',
-        'qs' => '',
+        'qs' => [
+          'action' => 'add',
+          'reset' => 1,
+          'id' => $id,
+          'is_refund' => 1,
+        ],
         'extra' => '',
       ];
     }
index f71c4272da4dd4cc5858f3076a2dcf9e48f03617..2127f3bcb54cf10929f321774df0e4cafd835f41 100644 (file)
@@ -357,6 +357,7 @@ class CRM_Contribute_Form_ContributionView extends CRM_Core_Form {
     $paymentInfo = CRM_Contribute_BAO_Contribution::getPaymentInfo($id, 'contribution', TRUE);
     $title = ts('View Payment');
     $this->assign('transaction', TRUE);
+    // Used in paymentInfoBlock.tpl
     $this->assign('payments', $paymentInfo['transaction']);
     $this->assign('paymentLinks', $paymentInfo['payment_links']);
     return $title;
index bcb23f9a56fd7fce8d1a16e44ab3f1dcef3afafc..b08f74aa3942f48ff3cfb3d8d417a54eaf27f5ab 100644 (file)
@@ -41,7 +41,7 @@
 {/if}
 
   {foreach from=$paymentLinks item=paymentLink}
-    <a class="open-inline action-item crm-hover-button" href="{$paymentLink.url}"><i class="crm-i fa-chevron-right" aria-hidden="true"></i> {ts}{$paymentLink.title}{/ts}</a>
+    <a class="open-inline action-item crm-hover-button" href="{crmURL p=$paymentLink.url q=$paymentLink.qs}"><i class="crm-i fa-chevron-right" aria-hidden="true"></i> {ts}{$paymentLink.title}{/ts}</a>
   {/foreach}
 
 {/crmRegion}