From 7595b57f20795e8fa2ac0d468c16ec667c6b423f Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 30 Oct 2015 10:57:09 -0700 Subject: [PATCH] CRM-16373 - Settings - Fix default for ext_repo_url --- CRM/Extension/Browser.php | 4 +++ CRM/Extension/System.php | 3 +- settings/Extension.setting.php | 58 ++++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 settings/Extension.setting.php diff --git a/CRM/Extension/Browser.php b/CRM/Extension/Browser.php index 734fa50087..9abbd7a12c 100644 --- a/CRM/Extension/Browser.php +++ b/CRM/Extension/Browser.php @@ -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}'; diff --git a/CRM/Extension/System.php b/CRM/Extension/System.php index 32df05d4d7..9ffccd35e6 100644 --- a/CRM/Extension/System.php +++ b/CRM/Extension/System.php @@ -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 index 0000000000..c1a0432e45 --- /dev/null +++ b/settings/Extension.setting.php @@ -0,0 +1,58 @@ + 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' => '', + ), +); -- 2.25.1