Ensure assigned smarty array has empty keys (not no keys)
authorEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 5 Jan 2022 06:19:20 +0000 (19:19 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 5 Jan 2022 06:49:23 +0000 (19:49 +1300)
CRM/Contribute/Selector/Search.php
templates/CRM/Contribute/Form/Selector.tpl

index 3f9a5dc2fb10f5d91d7f5c8fe538c9929be788c2..764a597891722d7270f55eba7d0120e499c5a4fb 100644 (file)
@@ -500,6 +500,7 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C
         'sort' => 'total_amount',
         'direction' => CRM_Utils_Sort::DONTCARE,
         'field_name' => 'total_amount',
+        'type' => '',
       ],
     ];
     if ($this->_includeSoftCredits) {
@@ -512,6 +513,7 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C
               'sort' => 'contribution_soft_credit_amount',
               'field_name' => 'contribution_soft_credit_amount',
               'direction' => CRM_Utils_Sort::DONTCARE,
+              'type' => '',
             ],
           ]
         );
@@ -525,12 +527,14 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C
             'sort' => 'financial_type',
             'field_name' => 'financial_type',
             'direction' => CRM_Utils_Sort::DONTCARE,
+            'type' => '',
           ],
           [
             'name' => ts('Source'),
             'sort' => 'contribution_source',
             'field_name' => 'contribution_source',
             'direction' => CRM_Utils_Sort::DONTCARE,
+            'type' => '',
           ],
           [
             'name' => ts('Received'),
@@ -551,6 +555,7 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C
             'sort' => 'contribution_status',
             'field_name' => 'contribution_status',
             'direction' => CRM_Utils_Sort::DONTCARE,
+            'type' => '',
           ],
         ]
       );
@@ -560,6 +565,7 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C
         'sort' => 'product_name',
         'field_name' => 'product_name',
         'direction' => CRM_Utils_Sort::DONTCARE,
+        'type' => '',
       ];
     }
     if (!$this->_single) {
@@ -567,7 +573,9 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C
         [
           'name' => ts('Name'),
           'sort' => 'sort_name',
+          'field_name' => '',
           'direction' => CRM_Utils_Sort::DONTCARE,
+          'type' => '',
         ],
       ];
     }
@@ -580,11 +588,13 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C
             'name' => ts('Soft Credit For'),
             'sort' => 'contribution_soft_credit_name',
             'direction' => CRM_Utils_Sort::DONTCARE,
+            'field_name' => '',
           ],
           [
             'name' => ts('Soft Credit Type'),
             'sort' => 'contribution_soft_credit_type',
             'direction' => CRM_Utils_Sort::ASCENDING,
+            'field_name' => '',
           ],
         ]
       );
@@ -592,7 +602,7 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C
     self::$_columnHeaders
       = array_merge(
         self::$_columnHeaders, [
-          ['desc' => ts('Actions'), 'type' => 'actions'],
+          ['desc' => ts('Actions'), 'type' => 'actions', 'field_name' => ''],
         ]
       );
     foreach (array_keys(self::$_columnHeaders) as $index) {
index 7b377458f29170d30352e4fbc0a05d8e71820c93..d522a3fc87ea5e8602d1e9a85813c59dcb7695e7 100644 (file)
           {/if}
         </td>
       {foreach from=$columnHeaders item=column}
-          {assign var='columnName' value=''}
-          {if $column.field_name}
-            {assign var='columnName' value=$column.field_name}
-          {/if}
+        {assign var='columnName' value=$column.field_name}
         {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 *}
@@ -76,7 +73,7 @@
               {$row.$columnName|crmDate}
             </td>
           {else}
-          <td class="crm-{$columnName} crm-{$columnName}_{if $row.columnName}{$row.columnName}{/if}">
+          <td class="crm-{$columnName} crm-{$columnName}_">
             {$row.$columnName}
           </td>
           {/if}