CRM-17830 - Setting Form - Remove redundant default check
authorTim Otten <totten@civicrm.org>
Wed, 20 Jan 2016 23:49:05 +0000 (15:49 -0800)
committerTim Otten <totten@civicrm.org>
Thu, 21 Jan 2016 00:16:18 +0000 (16:16 -0800)
Default values should already be merged within SettingsBag (which sits
under-the-hood, beneath Setting::getItem and Setting API). Don't see why
we need to explicitly check default in this form.

CRM/Admin/Form/Setting.php

index 7503ab7c51ce9551bb8d9d5d2d8559859299d95f..3064e2c9c4cc3c8fcf6e58d68c146f500cc80f75 100644 (file)
@@ -56,12 +56,10 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form {
 
       // we can handle all the ones defined in the metadata here. Others to be converted
       foreach ($this->_settings as $setting => $group) {
-        $settingMetaData = civicrm_api('setting', 'getfields', array('version' => 3, 'name' => $setting));
         $this->_defaults[$setting] = civicrm_api('setting', 'getvalue', array(
             'version' => 3,
             'name' => $setting,
             'group' => $group,
-            'default_value' => CRM_Utils_Array::value('default', $settingMetaData['values'][$setting]),
           )
         );
       }