Merge pull request #1761 from davecivicrm/CRM-12963
[civicrm-core.git] / CRM / Admin / Form / Setting.php
index 80ea92057dd19f0918cebd7df6a0fe19cf492c1a..9344e6cd0c78933db368f90cb7d20a8eb50057e9 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.4                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2013                                |
  +--------------------------------------------------------------------+
@@ -219,6 +219,16 @@ LIMIT  1
       unset($params['autocompleteContactReference']);
     }
 
+    // save components to be enabled
+    if (array_key_exists('enableComponents', $params)) {
+      CRM_Core_BAO_Setting::setItem($params['enableComponents'],
+        CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,'enable_components');
+
+      // unset params by emptying the values, so while retrieving we can detect and load from settings table
+      // instead of config-backend for backward compatibility. We could use unset() in later releases.
+      $params['enableComponents'] = $params['enableComponentIDs'] = array();
+    }
+
     // save checksum timeout
     if (CRM_Utils_Array::value('checksumTimeout', $params)) {
       CRM_Core_BAO_Setting::setItem($params['checksumTimeout'],