From ae1c8b1fa004ce553784d85dba6c106d898eaaf2 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 17 Feb 2020 20:37:54 +1300 Subject: [PATCH] Remove helper function now that contribution settings is not weirdly stored This is the only place that accesses this function / setting - it's as if it were defined properly all along now - it was all just a dream. --- CRM/Contribute/Page/UserDashboard.php | 2 +- CRM/Invoicing/Utils.php | 18 ------------------ 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/CRM/Contribute/Page/UserDashboard.php b/CRM/Contribute/Page/UserDashboard.php index ce242c06ab..dc8707155c 100644 --- a/CRM/Contribute/Page/UserDashboard.php +++ b/CRM/Contribute/Page/UserDashboard.php @@ -54,7 +54,7 @@ class CRM_Contribute_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBo 'label' => ts('Pay Now'), 'url' => CRM_Utils_System::url('civicrm/contribute/transact', [ 'reset' => 1, - 'id' => CRM_Invoicing_Utils::getDefaultPaymentPage(), + 'id' => Civi::settings()->get('default_invoice_page'), 'ccid' => $row['contribution_id'], 'cs' => $this->getUserChecksum(), 'cid' => $row['contact_id'], diff --git a/CRM/Invoicing/Utils.php b/CRM/Invoicing/Utils.php index 6f0bc50cf2..daf3088747 100644 --- a/CRM/Invoicing/Utils.php +++ b/CRM/Invoicing/Utils.php @@ -62,24 +62,6 @@ class CRM_Invoicing_Utils { return CRM_Utils_Array::value('invoicing', $invoiceSettings); } - /** - * Function to call to determine default invoice page. - * - * Historically the invoicing was declared as a setting but actually - * set within contribution_invoice_settings (which stores multiple settings - * as an array in a non-standard way). - * - * We check both here. But will deprecate the latter in time. - */ - public static function getDefaultPaymentPage() { - $value = Civi::settings()->get('default_invoice_page'); - if (is_numeric($value)) { - return $value; - } - $invoiceSettings = Civi::settings()->get('contribution_invoice_settings'); - return CRM_Utils_Array::value('default_invoice_page', $invoiceSettings); - } - /** * Function to get the tax term. * -- 2.25.1