Details
-
Type: Sub-task
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.7
-
Fix Version/s: 4.7
-
Component/s: Core CiviCRM
-
Labels:
-
Documentation Required?:None
-
Funding Source:Core Team Funds
Description
v4.7 made a few changes to the settings code – default values are now strictly loaded via "settings/*.setting.php", and the groups are no longer meaningful. This means that should be changed like:
OLD: CRM_Core_BAO_Settings::getItem('Foo Preferences', 'foobar', NULL, 'default');
NEW: Civi::settings()->get('foobar');
ALSO: Double-check the default value in `settings/*.setting.php`. If missing, add it.
If code supplies a default using the old notation, then it generates a warning. For example:
Nov 02 14:05:07 [info] Deprecated: Group='CiviCRM Preferences'. Name='versionAlert'. Defaults should come from metadata
Nov 02 14:14:32 [info] Deprecated: Group='Personal Preferences'. Name='navigation'. Defaults should come from metadata
Nov 02 14:05:07 [info] Deprecated: Group='CiviCRM Preferences'. Name='versionCheck'. Defaults should come from metadata
Nov 02 14:05:10 [info] Deprecated: Group='Extension Preferences'. Name='ext_repo_url'. Defaults should come from metadata
Nov 02 14:05:10 [info] Deprecated: Group='CiviCRM Preferences'. Name='securityAlert'. Defaults should come from metadata
Example: This PR fixes `ext_repo_url` errors. https://github.com/civicrm/civicrm-core/pull/7092
We should track down other examples and fix them.
------
Aside: One of those is "Personal Preferences". Take special care with that one. There should only be one or two settings at the contact level, but these require a more verbose notation:
Civi::service('settings_manager')
->getBagByContact(NULL, $userID);
->get('foo');
------
Yashi, is this something we could assign to someone at WA?