CRM-16373 - Settings - Fix default for ext_repo_url
authorTim Otten <totten@civicrm.org>
Fri, 30 Oct 2015 17:57:09 +0000 (10:57 -0700)
committerTim Otten <totten@civicrm.org>
Fri, 30 Oct 2015 17:57:09 +0000 (10:57 -0700)
CRM/Extension/Browser.php
CRM/Extension/System.php
settings/Extension.setting.php [new file with mode: 0644]

index 734fa5008744477b8c5c0d25a4c8d09b1ff0cb9a..9abbd7a12c3c24e460f06a48fec67821a349c640 100644 (file)
@@ -36,6 +36,10 @@ class CRM_Extension_Browser {
 
   /**
    * An URL for public extensions repository.
+   *
+   * Note: This default is now handled through setting/*.php.
+   *
+   * @deprecated
    */
   const DEFAULT_EXTENSIONS_REPOSITORY = 'https://civicrm.org/extdir/ver={ver}|cms={uf}';
 
index 32df05d4d7f5fbbea7fb67b2e33fc5ae8766a73d..9ffccd35e6c4c0d3052d8d51158b87ce326a633b 100644 (file)
@@ -256,8 +256,7 @@ class CRM_Extension_System {
    */
   public function getRepositoryUrl() {
     if (empty($this->_repoUrl) && $this->_repoUrl !== FALSE) {
-      $config = CRM_Core_Config::singleton();
-      $url = CRM_Core_BAO_Setting::getItem('Extension Preferences', 'ext_repo_url', NULL, CRM_Extension_Browser::DEFAULT_EXTENSIONS_REPOSITORY);
+      $url = Civi::settings()->get('ext_repo_url');
 
       // boolean false means don't try to check extensions
       // CRM-10575
diff --git a/settings/Extension.setting.php b/settings/Extension.setting.php
new file mode 100644 (file)
index 0000000..c1a0432
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+/*
+ +--------------------------------------------------------------------+
+ | CiviCRM version 4.7                                                |
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
+ +--------------------------------------------------------------------+
+ | This file is a part of CiviCRM.                                    |
+ |                                                                    |
+ | CiviCRM is free software; you can copy, modify, and distribute it  |
+ | under the terms of the GNU Affero General Public License           |
+ | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |
+ |                                                                    |
+ | CiviCRM is distributed in the hope that it will be useful, but     |
+ | WITHOUT ANY WARRANTY; without even the implied warranty of         |
+ | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |
+ | See the GNU Affero General Public License for more details.        |
+ |                                                                    |
+ | You should have received a copy of the GNU Affero General Public   |
+ | License and the CiviCRM Licensing Exception along                  |
+ | with this program; if not, contact CiviCRM LLC                     |
+ | at info[AT]civicrm[DOT]org. If you have questions about the        |
+ | GNU Affero General Public License or the licensing of CiviCRM,     |
+ | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
+ +--------------------------------------------------------------------+
+ */
+
+/**
+ *
+ * @package CRM
+ * @copyright CiviCRM LLC (c) 2004-2015
+ * $Id$
+ *
+ */
+/*
+ * Settings metadata file
+ */
+return array(
+  'ext_repo_url' => array(
+    'group_name' => 'Extension Preferences',
+    'group' => 'ext',
+    'name' => 'ext_repo_url',
+    'type' => 'String',
+    'quick_form_type' => 'Element',
+    'html_attributes' => array(
+      'size' => 64,
+      'maxlength' => 128,
+    ),
+    'html_type' => 'Text',
+    'default' => 'https://civicrm.org/extdir/ver={ver}|cms={uf}',
+    'add' => '4.3',
+    'title' => 'Extension Repo URL',
+    'is_domain' => 1,
+    'is_contact' => 0,
+    'description' => '',
+    'help_text' => '',
+  ),
+);