dev/core#1391 - Fix contribution cancel_date not being loaded
authorPatrick Figel <pfigel@greenpeace.org>
Thu, 14 Nov 2019 13:19:04 +0000 (14:19 +0100)
committerPatrick Figel <pfigel@greenpeace.org>
Mon, 18 Nov 2019 10:38:10 +0000 (11:38 +0100)
This fixes an issue where the contribution cancel_date is not loaded
in the contribution search, causing cancelled contributions not to be
greyed out and the cancel date not to be shown.

CRM/Contribute/BAO/Query.php
CRM/Contribute/Selector/Search.php
templates/CRM/Contribute/Form/Selector.tpl
templates/CRM/Contribute/Form/Task/Print.tpl

index 0d2462ae780767de4a14097aaf9655f393fdbb8a..8cdfda57356cea319f6152b9e547cdd369b86810 100644 (file)
@@ -756,7 +756,7 @@ class CRM_Contribute_BAO_Query extends CRM_Core_BAO_Query {
       // @todo return this & fix query to do pseudoconstant thing.
       'contribution_status' => 1,
       'currency' => 1,
-      'cancel_date' => 1,
+      'contribution_cancel_date' => 1,
       'contribution_recur_id' => 1,
     ];
     if (self::isSiteHasProducts()) {
index 1c2d23a3bc422c5019bf404320f8c0b8f9f3fa78..0c26fb6cbe0f0adc4fa01c10b2cb1e5008fd48e0 100644 (file)
@@ -66,7 +66,7 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C
     'thankyou_date',
     'contribution_status_id',
     'contribution_status',
-    'cancel_date',
+    'contribution_cancel_date',
     'product_name',
     'is_test',
     'contribution_recur_id',
index 144d6544db43661bf2e6e125d00ac0afb43da6ac..bcf283e209dd322d19d3f848070ea5a178aeeb8d 100644 (file)
@@ -51,7 +51,7 @@
 
     {counter start=0 skip=1 print=false}
     {foreach from=$rows item=row}
-      <tr id="rowid{$row.contribution_id}" class="{cycle values="odd-row,even-row"} {if $row.cancel_date} cancelled{/if} crm-contribution_{$row.contribution_id}">
+      <tr id="rowid{$row.contribution_id}" class="{cycle values="odd-row,even-row"} {if $row.contribution_cancel_date} cancelled{/if} crm-contribution_{$row.contribution_id}">
         {if !$single }
           {if $context eq 'Search' }
             {assign var=cbName value=$row.checkbox}
         {if !$columnName}{* if field_name has not been set skip, this helps with not changing anything not specifically edited *}
         {elseif $columnName === 'total_amount'}{* rendered above as soft credit columns = confusing *}
         {elseif $column.type === 'actions'}{* rendered below as soft credit column handling = not fixed *}
-        {elseif $columnName == 'contribution-status'}
+        {elseif $columnName == 'contribution_status'}
           <td class="crm-contribution-status">
             {$row.contribution_status}<br/>
-            {if $row.cancel_date}
-              {$row.cancel_date|crmDate}
+            {if $row.contribution_cancel_date}
+              {$row.contribution_cancel_date|crmDate}
             {/if}
           </td>
         {else}
index ca8cf7a2d17a73ffcf8a6986406ca25ebfdf1d34..dcf77779c35ea6fc3cf373c725b8dae5ab342bc1 100644 (file)
@@ -53,8 +53,8 @@
         <td class="crm-contribution-thankyou_date">{$row.thankyou_date|truncate:10:''|crmDate}</td>
         <td class="crm-contribution-status crm-contribution-status_{$row.contribution_status_id}">
             {$row.contribution_status_id}<br />
-            {if $row.cancel_date}
-                {$row.cancel_date|truncate:10:''|crmDate}
+            {if $row.contribution_cancel_date}
+                {$row.contribution_cancel_date|truncate:10:''|crmDate}
             {/if}
         </td>
         <td class="crm-contribution-product_name">{$row.product_name}</td>