From 47279db3cf459f85d98ce6e359a7fb0ff5762025 Mon Sep 17 00:00:00 2001 From: eileen Date: Tue, 20 Nov 2018 16:15:44 +1300 Subject: [PATCH] Fix saving of invoicing. Invoicing has setting metadata but this setting is ignored in various places in core in favour of using a hacky method. Don't break when hackiness ensues --- CRM/Admin/Form/Preferences/Contribute.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CRM/Admin/Form/Preferences/Contribute.php b/CRM/Admin/Form/Preferences/Contribute.php index 7efb2d2e1e..111111d514 100644 --- a/CRM/Admin/Form/Preferences/Contribute.php +++ b/CRM/Admin/Form/Preferences/Contribute.php @@ -187,6 +187,11 @@ class CRM_Admin_Form_Preferences_Contribute extends CRM_Admin_Form_Preferences { // store the submitted values in an array $params = $this->controller->exportValues($this->_name); $invoiceParams = array_intersect_key($params, $this->invoiceSettings); + // This is a hack - invoicing is it's own setting but it is being used from invoice params + // too. This means that saving from api will not have the desired core effect. + // but we should fix that elsewhere - ie. stop abusing the settings + // and fix the code repetition associated with invoicing + $invoiceParams['invoicing'] = CRM_Utils_Array::value('invoicing', $params, 0); Civi::settings()->set('contribution_invoice_settings', $invoiceParams); parent::postProcess(); -- 2.25.1