From 52baaadfe713ff5ae123b5bca12dedcc06eee189 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Sat, 12 Sep 2015 00:15:21 -0700 Subject: [PATCH] Settings - Remove special cases for `prefetch` and `config_only` --- CRM/Core/BAO/Setting.php | 67 ++++++++-------------------- settings/Core.setting.php | 26 ----------- settings/Developer.setting.php | 4 -- settings/Localization.setting.php | 35 --------------- settings/Mailing.setting.php | 5 --- settings/Map.setting.php | 4 -- settings/Search.setting.php | 17 ------- tests/phpunit/api/v3/SettingTest.php | 10 ----- 8 files changed, 19 insertions(+), 149 deletions(-) diff --git a/CRM/Core/BAO/Setting.php b/CRM/Core/BAO/Setting.php index 85a45d71e6..3d80bd0204 100644 --- a/CRM/Core/BAO/Setting.php +++ b/CRM/Core/BAO/Setting.php @@ -274,29 +274,14 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { $config = CRM_Core_Config::singleton($reloadConfig, $reloadConfig); $result[$domainID] = array(); foreach ($fieldsToGet as $name => $value) { - if (!empty($fields['values'][$name]['prefetch'])) { - if (isset($params['filters']) && isset($params['filters']['prefetch']) - && $params['filters']['prefetch'] == 0 - ) { - // we are filtering out the prefetches from the return array - // so we will skip - continue; - } - $configKey = CRM_Utils_Array::value('config_key', $fields['values'][$name], $name); - if (isset($config->$configKey)) { - $setting = $config->$configKey; - } - } - else { - $setting = CRM_Core_BAO_Setting::getItem( - $fields['values'][$name]['group_name'], - $name, - CRM_Utils_Array::value('component_id', $params), - NULL, - CRM_Utils_Array::value('contact_id', $params), - $domainID - ); - } + $setting = CRM_Core_BAO_Setting::getItem( + $fields['values'][$name]['group_name'], + $name, + CRM_Utils_Array::value('component_id', $params), + NULL, + CRM_Utils_Array::value('contact_id', $params), + $domainID + ); if (!is_null($setting)) { // we won't return if not set - helps in return all scenario - otherwise we can't indentify the missing ones // e.g for revert of fill actions @@ -430,8 +415,6 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { * Store multiple items in the setting table. Note that this will also store config keys * the storage is determined by the metdata and is affected by * 'name' setting's name - * 'prefetch' = store in config - * 'config_only' = don't store in settings * 'config_key' = the config key is different to the settings key - e.g. debug where there was a conflict * 'legacy_key' = rename from config or setting with this name * @@ -470,15 +453,7 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { $result[$domainID] = array(); $realSettingsToSet = array(); // need to separate config_backend stuff foreach ($fieldsToSet as $name => $value) { - if (empty($fields['values'][$name]['config_only'])) { - $realSettingsToSet[$name] = $value; - } - if (!empty($fields['values'][$name]['prefetch'])) { - if (!empty($fields['values'][$name]['config_key'])) { - $name = $fields['values'][$name]['config_key']; - } - $config_keys[$name] = $value; - } + $realSettingsToSet[$name] = $value; $result[$domainID][$name] = $value; } $manager->getBagByDomain($domainID)->add($realSettingsToSet); @@ -688,21 +663,17 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { } $spec = self::getSettingSpecification(NULL, array('name' => $name), $domainID); $configKey = CRM_Utils_Array::value('config_key', $spec[$name], CRM_Utils_Array::value('legacy_key', $spec[$name], $name)); - //if the key is set to config_only we don't need to do anything - if (empty($spec[$name]['config_only'])) { - if (!empty($values[$configKey])) { - civicrm_api('setting', 'create', array('version' => 3, $name => $values[$configKey], 'domain_id' => $domainID)); - } - else { - civicrm_api('setting', 'fill', array('version' => 3, 'name' => $name, 'domain_id' => $domainID)); - } + if (!empty($values[$configKey])) { + civicrm_api('setting', 'create', array('version' => 3, $name => $values[$configKey], 'domain_id' => $domainID)); + } + else { + civicrm_api('setting', 'fill', array('version' => 3, 'name' => $name, 'domain_id' => $domainID)); + } - if (empty($spec[$name]['prefetch']) && !empty($values[$configKey])) { - unset($values[$configKey]); - $domain->config_backend = serialize($values); - $domain->save(); - unset($config->$configKey); - } + if (!empty($values[$configKey])) { + unset($values[$configKey]); + $domain->config_backend = serialize($values); + $domain->save(); } } diff --git a/settings/Core.setting.php b/settings/Core.setting.php index 6cbf8e2b35..6b97c170a4 100644 --- a/settings/Core.setting.php +++ b/settings/Core.setting.php @@ -285,7 +285,6 @@ return array( 'group' => 'core', 'name' => 'max_attachments', 'legacy_key' => 'maxAttachments', - 'prefetch' => 0, 'type' => 'Integer', 'quick_form_type' => 'Element', 'html_type' => 'text', @@ -305,8 +304,6 @@ return array( 'group_name' => 'CiviCRM Preferences', 'group' => 'core', 'name' => 'maxFileSize', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'Integer', 'quick_form_type' => 'Element', 'html_type' => 'text', @@ -412,8 +409,6 @@ return array( 'group_name' => 'CiviCRM Preferences', 'group' => 'core', 'name' => 'doNotAttachPDFReceipt', - 'prefetch' => 1, - // prefetch causes it to be cached in config object. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'Boolean', 'quick_form_type' => 'YesNo', 'default' => 1, @@ -428,8 +423,6 @@ return array( 'group_name' => 'CiviCRM Preferences', 'group' => 'core', 'name' => 'wkhtmltopdfPath', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'String', 'quick_form_type' => 'Element', 'html_attributes' => array( @@ -449,8 +442,6 @@ return array( 'group_name' => 'CiviCRM Preferences', 'group' => 'core', 'name' => 'recaptchaOptions', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'String', 'quick_form_type' => 'Element', 'html_attributes' => array( @@ -470,8 +461,6 @@ return array( 'group_name' => 'CiviCRM Preferences', 'group' => 'core', 'name' => 'recaptchaPublicKey', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'String', 'quick_form_type' => 'Element', 'html_attributes' => array( @@ -491,8 +480,6 @@ return array( 'group_name' => 'CiviCRM Preferences', 'group' => 'core', 'name' => 'recaptchaPrivateKey', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'String', 'quick_form_type' => 'Element', 'html_attributes' => array( @@ -512,8 +499,6 @@ return array( 'group_name' => 'CiviCRM Preferences', 'group' => 'core', 'name' => 'dashboardCacheTimeout', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'Integer', 'quick_form_type' => 'Element', 'html_attributes' => array( @@ -552,7 +537,6 @@ return array( 'group_name' => 'CiviCRM Preferences', 'group' => 'core', 'name' => 'blogUrl', - 'prefetch' => 0, 'type' => 'String', 'quick_form_type' => 'Element', 'html_attributes' => array( @@ -572,7 +556,6 @@ return array( 'group_name' => 'CiviCRM Preferences', 'group' => 'core', 'name' => 'communityMessagesUrl', - 'prefetch' => 0, 'type' => 'String', 'quick_form_type' => 'Element', 'html_attributes' => array( @@ -642,8 +625,6 @@ return array( 'type' => 'String', 'html_type' => 'text', 'quick_form_type' => 'Element', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'default' => '', 'add' => '4.3', 'title' => 'WordPress Base Page', @@ -656,8 +637,6 @@ return array( 'group_name' => 'CiviCRM Preferences', 'group' => 'core', 'name' => 'secondDegRelPermissions', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'Boolean', 'quick_form_type' => 'YesNo', 'default' => 0, @@ -711,8 +690,6 @@ return array( 'group_name' => 'CiviCRM Preferences', 'group' => 'core', 'name' => 'empoweredBy', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'Boolean', 'quick_form_type' => 'YesNo', 'default' => 1, @@ -725,7 +702,6 @@ return array( ), 'logging' => array( 'add' => '4.7', - 'prefetch' => 1, 'help_text' => NULL, 'is_domain' => 1, 'is_contact' => 0, @@ -769,8 +745,6 @@ return array( 'type' => 'String', 'html_type' => 'text', 'quick_form_type' => 'Element', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'default' => '', 'add' => '4.6', 'title' => 'WordPress Path to wp-load.php', diff --git a/settings/Developer.setting.php b/settings/Developer.setting.php index 77845e3e48..f94312eff1 100644 --- a/settings/Developer.setting.php +++ b/settings/Developer.setting.php @@ -49,7 +49,6 @@ return array( 'is_domain' => 1, 'is_contact' => 0, 'description' => "Set this value to Yes if you want CiviCRM error/debugging messages to appear in the Drupal error logs", - 'prefetch' => 1, 'help_text' => "Set this value to Yes if you want CiviCRM error/debugging messages the appear in your CMS' error log. In the case of Drupal, this will cause all CiviCRM error messages to appear in the watchdog (assuming you have Drupal's watchdog enabled)", ), 'debug_enabled' => array( @@ -65,7 +64,6 @@ return array( 'is_domain' => 1, 'is_contact' => 0, 'description' => "Set this value to Yes if you want to use one of CiviCRM's debugging tools. This feature should NOT be enabled for production sites", - 'prefetch' => 1, 'help_text' => 'Do not turn this on on production sites', ), 'backtrace' => array( @@ -80,7 +78,6 @@ return array( 'is_domain' => 1, 'is_contact' => 0, 'description' => "Set this value to Yes if you want to display a backtrace listing when a fatal error is encountered. This feature should NOT be enabled for production sites", - 'prefetch' => 1, ), 'fatalErrorHandler' => array( 'group_name' => 'Developer Preferences', @@ -95,6 +92,5 @@ return array( 'is_domain' => 1, 'is_contact' => 0, 'description' => "Enter the path and class for a custom PHP error-handling function if you want to override built-in CiviCRM error handling for your site.", - 'prefetch' => 1, ), ); diff --git a/settings/Localization.setting.php b/settings/Localization.setting.php index 326969b764..f8aca26282 100644 --- a/settings/Localization.setting.php +++ b/settings/Localization.setting.php @@ -39,7 +39,6 @@ return array( 'customTranslateFunction' => array( 'add' => '4.7', - 'prefetch' => 1, 'help_text' => NULL, 'is_domain' => 1, 'is_contact' => 0, @@ -61,8 +60,6 @@ return array( 'group_name' => 'Localization Preferences', 'group' => 'localization', 'name' => 'monetaryThousandSeparator', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'String', 'quick_form_type' => 'Element', 'html_type' => 'text', @@ -81,8 +78,6 @@ return array( 'group_name' => 'Localization Preferences', 'group' => 'localization', 'name' => 'monetaryDecimalPoint', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'String', 'quick_form_type' => 'Element', 'html_type' => 'text', @@ -101,8 +96,6 @@ return array( 'group_name' => 'Localization Preferences', 'group' => 'localization', 'name' => 'moneyformat', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'String', 'quick_form_type' => 'Element', 'html_type' => 'text', @@ -118,8 +111,6 @@ return array( 'group_name' => 'Localization Preferences', 'group' => 'localization', 'name' => 'moneyvalueformat', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'String', 'quick_form_type' => 'Element', 'html_type' => 'text', @@ -135,8 +126,6 @@ return array( 'group_name' => 'Localization Preferences', 'group' => 'localization', 'name' => 'defaultCurrency', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'String', 'quick_form_type' => 'Select', 'html_type' => 'Select', @@ -158,8 +147,6 @@ return array( 'group_name' => 'Localization Preferences', 'group' => 'localization', 'name' => 'defaultContactCountry', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'String', 'quick_form_type' => 'Select', 'html_type' => 'Select', @@ -179,7 +166,6 @@ return array( ), 'defaultContactStateProvince' => array( 'add' => '4.7', - 'prefetch' => 1, 'help_text' => NULL, 'is_domain' => 1, 'is_contact' => 0, @@ -201,8 +187,6 @@ return array( 'group_name' => 'Localization Preferences', 'group' => 'localization', 'name' => 'countryLimit', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'Array', 'quick_form_type' => 'Select', 'html_type' => 'Select', @@ -225,8 +209,6 @@ return array( 'group_name' => 'Localization Preferences', 'group' => 'localization', 'name' => 'provinceLimit', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'Array', 'quick_form_type' => 'Select', 'html_type' => 'Select', @@ -249,8 +231,6 @@ return array( 'group_name' => 'Localization Preferences', 'group' => 'localization', 'name' => 'inheritLocale', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'Boolean', 'quick_form_type' => 'YesNo', 'default' => '0', @@ -265,8 +245,6 @@ return array( 'group_name' => 'Localization Preferences', 'group' => 'localization', 'name' => 'dateformatDatetime', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'String', 'quick_form_type' => 'Element', 'html_type' => 'text', @@ -282,8 +260,6 @@ return array( 'group_name' => 'Localization Preferences', 'group' => 'localization', 'name' => 'dateformatFull', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'String', 'quick_form_type' => 'Element', 'html_type' => 'text', @@ -299,8 +275,6 @@ return array( 'group_name' => 'Localization Preferences', 'group' => 'localization', 'name' => 'dateformatPartial', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'String', 'quick_form_type' => 'Element', 'html_type' => 'text', @@ -314,7 +288,6 @@ return array( ), 'dateformatTime' => array( 'add' => '4.7', - 'prefetch' => 1, 'help_text' => NULL, 'is_domain' => 1, 'is_contact' => 0, @@ -334,7 +307,6 @@ return array( ), 'dateformatYear' => array( 'add' => '4.7', - 'prefetch' => 1, 'help_text' => NULL, 'is_domain' => 1, 'is_contact' => 0, @@ -354,7 +326,6 @@ return array( ), 'dateInputFormat' => array( 'add' => '4.7', - 'prefetch' => 1, 'help_text' => NULL, 'is_domain' => 1, 'is_contact' => 0, @@ -373,7 +344,6 @@ return array( ), 'fieldSeparator' => array( 'add' => '4.7', - 'prefetch' => 1, 'help_text' => NULL, 'is_domain' => 1, 'is_contact' => 0, @@ -393,7 +363,6 @@ return array( ), 'fiscalYearStart' => array( 'add' => '4.7', - 'prefetch' => 1, 'help_text' => NULL, 'is_domain' => 1, 'is_contact' => 0, @@ -433,8 +402,6 @@ return array( 'group_name' => 'Localization Preferences', 'group' => 'localization', 'name' => 'lcMessages', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'String', 'quick_form_type' => 'Select', 'html_type' => 'Select', @@ -457,7 +424,6 @@ return array( ), 'legacyEncoding' => array( 'add' => '4.7', - 'prefetch' => 1, 'help_text' => NULL, 'is_domain' => 1, 'is_contact' => 0, @@ -477,7 +443,6 @@ return array( ), 'timeInputFormat' => array( 'add' => '4.7', - 'prefetch' => 1, 'help_text' => NULL, 'is_domain' => 1, 'is_contact' => 0, diff --git a/settings/Mailing.setting.php b/settings/Mailing.setting.php index 4e999a2293..b940aaea37 100644 --- a/settings/Mailing.setting.php +++ b/settings/Mailing.setting.php @@ -224,7 +224,6 @@ return array( 'is_contact' => 0, 'description' => 'Throttle email delivery by setting the maximum number of emails sent during each CiviMail run (0 = unlimited).', 'help_text' => NULL, - 'prefetch' => 1, ), 'mailerJobSize' => array( 'group_name' => 'Mailing Preferences', @@ -244,7 +243,6 @@ return array( 'is_contact' => 0, 'description' => 'If you want to utilize multi-threading enter the size you want your sub jobs to be split into. Recommended values are between 1,000 and 10,000. Use a lower value if your server has multiple cron jobs running simultaneously, but do not use values smaller than 1,000. Enter "0" to disable multi-threading and process mail as one single job - batch limits still apply.', 'help_text' => NULL, - 'prefetch' => 1, ), 'mailerJobsMax' => array( 'group_name' => 'Mailing Preferences', @@ -264,7 +262,6 @@ return array( 'is_contact' => 0, 'description' => 'The maximum number of mailer delivery jobs executing simultaneously (0 = allow as many processes to execute as started by cron)', 'help_text' => NULL, - 'prefetch' => 1, ), 'mailThrottleTime' => array( 'group_name' => 'Mailing Preferences', @@ -284,7 +281,6 @@ return array( 'is_contact' => 0, 'description' => 'The time to sleep in between each e-mail in micro seconds. Setting this above 0 allows you to control the rate at which e-mail messages are sent to the mail server, avoiding filling up the mail queue very quickly. Set to 0 to disable.', 'help_text' => NULL, - 'prefetch' => 1, ), 'verpSeparator' => array( 'group_name' => 'Mailing Preferences', @@ -304,6 +300,5 @@ return array( 'is_contact' => 0, 'description' => 'Separator character used when CiviMail generates VERP (variable envelope return path) Mail-From addresses.', 'help_text' => NULL, - 'prefetch' => 1, ), ); diff --git a/settings/Map.setting.php b/settings/Map.setting.php index 21dc6c51db..3f1a1003af 100644 --- a/settings/Map.setting.php +++ b/settings/Map.setting.php @@ -36,7 +36,6 @@ return array( 'geoAPIKey' => array( 'add' => '4.7', - 'prefetch' => 1, 'help_text' => NULL, 'is_domain' => 1, 'is_contact' => 0, @@ -56,7 +55,6 @@ return array( ), 'geoProvider' => array( 'add' => '4.7', - 'prefetch' => 1, 'help_text' => NULL, 'is_domain' => 1, 'is_contact' => 0, @@ -78,7 +76,6 @@ return array( ), 'mapAPIKey' => array( 'add' => '4.7', - 'prefetch' => 1, 'help_text' => NULL, 'is_domain' => 1, 'is_contact' => 0, @@ -98,7 +95,6 @@ return array( ), 'mapProvider' => array( 'add' => '4.7', - 'prefetch' => 1, 'help_text' => NULL, 'is_domain' => 1, 'is_contact' => 0, diff --git a/settings/Search.setting.php b/settings/Search.setting.php index b83d6330d9..90faa869ee 100644 --- a/settings/Search.setting.php +++ b/settings/Search.setting.php @@ -40,7 +40,6 @@ return array( 'group_name' => 'Search Preferences', 'group' => 'Search Preferences', 'name' => 'search_autocomplete_count', - 'prefetch' => 0, 'type' => 'Integer', 'quick_form_type' => 'Element', 'html_type' => 'text', @@ -60,7 +59,6 @@ return array( 'group_name' => 'Search Preferences', 'group' => 'Search Preferences', 'name' => 'enable_innodb_fts', - 'prefetch' => 0, 'type' => 'Boolean', 'quick_form_type' => 'YesNo', 'default' => 0, @@ -78,7 +76,6 @@ return array( 'group_name' => 'Search Preferences', 'group' => 'Search Preferences', 'name' => 'fts_query_mode', - 'prefetch' => 0, 'type' => 'String', 'quick_form_type' => 'Element', 'html_attributes' => array( @@ -98,8 +95,6 @@ return array( 'group_name' => 'Search Preferences', 'group' => 'Search Preferences', 'name' => 'includeOrderByClause', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'Boolean', 'quick_form_type' => 'YesNo', 'default' => 1, @@ -114,8 +109,6 @@ return array( 'group_name' => 'Search Preferences', 'group' => 'Search Preferences', 'name' => 'includeWildCardInName', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'Boolean', 'quick_form_type' => 'YesNo', 'default' => 1, @@ -130,8 +123,6 @@ return array( 'group_name' => 'Search Preferences', 'group' => 'Search Preferences', 'name' => 'includeEmailInName', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'Boolean', 'quick_form_type' => 'YesNo', 'default' => 1, @@ -146,8 +137,6 @@ return array( 'group_name' => 'Search Preferences', 'group' => 'Search Preferences', 'name' => 'includeNickNameInName', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'Boolean', 'quick_form_type' => 'YesNo', 'default' => 0, @@ -162,8 +151,6 @@ return array( 'group_name' => 'Search Preferences', 'group' => 'Search Preferences', 'name' => 'includeAlphabeticalPager', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'Boolean', 'quick_form_type' => 'YesNo', 'default' => 1, @@ -178,8 +165,6 @@ return array( 'group_name' => 'Search Preferences', 'group' => 'Search Preferences', 'name' => 'smartGroupCacheTimeout', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'Integer', 'quick_form_type' => 'Element', 'html_type' => 'text', @@ -195,8 +180,6 @@ return array( 'group_name' => 'Search Preferences', 'group' => 'Search Preferences', 'name' => 'defaultSearchProfileID', - 'prefetch' => 1, - // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent 'type' => 'Integer', 'quick_form_type' => 'Select', 'html_type' => 'Select', diff --git a/tests/phpunit/api/v3/SettingTest.php b/tests/phpunit/api/v3/SettingTest.php index 7b5dae352f..c0c56c2084 100644 --- a/tests/phpunit/api/v3/SettingTest.php +++ b/tests/phpunit/api/v3/SettingTest.php @@ -134,16 +134,6 @@ class api_v3_SettingTest extends CiviUnitTestCase { $this->assertArrayHasKey('domain_group_id', $result['values']); } - /** - * Test that getfields will filter on another field (prefetch) - */ - public function testGetFieldsPrefetchFilters() { - $params = array('filters' => array('prefetch' => 1)); - $result = $this->callAPISuccess('setting', 'getfields', $params); - $this->assertArrayNotHasKey('disable_mandatory_tokens_check', $result['values']); - $this->assertArrayHasKey('monetaryDecimalPoint', $result['values']); - } - /** * Ensure that on_change callbacks fire. * -- 2.25.1