dev/core#1558 Data conversion for non-standard setting.
authoreileen <emcnaughton@wikimedia.org>
Wed, 29 Jan 2020 21:49:16 +0000 (10:49 +1300)
committereileen <emcnaughton@wikimedia.org>
Thu, 30 Jan 2020 20:47:08 +0000 (09:47 +1300)
commitff6f993e56bf4f87caa0317ea3d1f883956b74da
treefaa774d7162b9faca82140613f40f846a051bdfc
parent41de5d4a9d8bc932899308987824131a7b41a838
dev/core#1558 Data conversion for non-standard setting.

Per https://lab.civicrm.org/dev/core/issues/1558 the 'contribution_invoice_settings' 'setting'
does not follow our standard of one setting per key and this has led to all sorts of hacks in various places.

In trying to unravel this I eventually concluded we needed an interim step where the data would be
stored as the correct settings but set and get would still work on the deprecated settinng. The reason for
goinng this way is that I found more than one place where extension code is accessing these settings
and the amount of work to fix up all the places in core that access it and the settings form were too big
to deal with without a stepping stone.

With this merged the settinngs are correctly defined and a definition for the deprecated setting still exists.

Requesting the deprecated setting returns an array retrieved from the correct settings so is unchanged from calling
functions point of view. Saving the deprecated setting saves to the correct places. However, it's now also
possible to get & set the correct settings and once the core places are removed we will deprecate & remove the
deprecated setting.

Unit tests cover past & desired behaviour and the upgrade routine.
CRM/Core/SelectValues.php
CRM/Invoicing/Utils.php
CRM/Upgrade/Incremental/Base.php
Civi/Core/SettingsBag.php
settings/Contribute.setting.php
tests/phpunit/CRM/Contact/Page/View/UserDashBoardTest.php
tests/phpunit/CRM/Core/BAO/SettingTest.php
tests/phpunit/CRM/Core/Payment/PayPalIPNTest.php
tests/phpunit/CRM/Financial/BAO/FinancialAccountTest.php
tests/phpunit/CRM/Upgrade/Incremental/BaseTest.php