From 7c9e1b3bf79f445abaf96e1b676f34e21afcd073 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 1 Dec 2021 11:31:20 +1300 Subject: [PATCH] Remove issets from payment processor form civicrm/admin/paymentProcessorType?reset=1 --- CRM/Admin/Page/PaymentProcessorType.php | 9 +++++++++ CRM/Core/Page/Basic.php | 16 ++++++++++++++++ .../CRM/Admin/Page/PaymentProcessorType.tpl | 4 ++-- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/CRM/Admin/Page/PaymentProcessorType.php b/CRM/Admin/Page/PaymentProcessorType.php index 78823ef480..5167b45afa 100644 --- a/CRM/Admin/Page/PaymentProcessorType.php +++ b/CRM/Admin/Page/PaymentProcessorType.php @@ -105,4 +105,13 @@ class CRM_Admin_Page_PaymentProcessorType extends CRM_Core_Page_Basic { return 'civicrm/admin/paymentProcessorType'; } + /** + * Get any properties that should always be present in each row (null if no value). + * + * @return array + */ + protected function getExpectedRowProperties(): array { + return ['class', 'description']; + } + } diff --git a/CRM/Core/Page/Basic.php b/CRM/Core/Page/Basic.php index 21b522032b..d87be66ddb 100644 --- a/CRM/Core/Page/Basic.php +++ b/CRM/Core/Page/Basic.php @@ -404,7 +404,23 @@ abstract class CRM_Core_Page_Basic extends CRM_Core_Page { } } } + foreach ($this->getExpectedRowProperties() as $key) { + foreach ($values as $index => $value) { + if (!array_key_exists($key, $value)) { + $values[$index][$key] = NULL; + } + } + } return $values; } + /** + * Get any properties that should always be present in each row (null if no value). + * + * @return array + */ + protected function getExpectedRowProperties(): array { + return []; + } + } diff --git a/templates/CRM/Admin/Page/PaymentProcessorType.tpl b/templates/CRM/Admin/Page/PaymentProcessorType.tpl index 2340f7e653..7580755844 100644 --- a/templates/CRM/Admin/Page/PaymentProcessorType.tpl +++ b/templates/CRM/Admin/Page/PaymentProcessorType.tpl @@ -31,10 +31,10 @@ {foreach from=$rows item=row} - + {$row.name} {$row.title} - {if isset($row.description)}{$row.description}{/if} + {$row.description} {if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if} {icon condition=$row.is_default}{ts}Default{/ts}{/icon}  {$row.action} -- 2.25.1