Skip to content

Commit

Permalink
MDL-58615 core: Remove the useexternalyui setting
Browse files Browse the repository at this point in the history
I have opted not to go through any deprecation process for this as there
is not really much we can do about it anyway. There is no loss of
functionality - just a change of where things are served from.

The Yahoo! CDN was only used for http connections as it did not
officially support SSL, and it is not guaranteed to continue existing in
the future since YUI has been deprecated for a number of years now.
  • Loading branch information
andrewnicols committed Jan 3, 2023
1 parent 12e9d9e commit 1ac2eb5
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 18 deletions.
1 change: 0 additions & 1 deletion admin/settings/appearance.php
Expand Up @@ -294,7 +294,6 @@
$ADMIN->add('appearance', $temp);

$temp = new admin_settingpage('ajax', new lang_string('ajaxuse'));
$temp->add(new admin_setting_configcheckbox('useexternalyui', new lang_string('useexternalyui', 'admin'), new lang_string('configuseexternalyui', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('yuicomboloading', new lang_string('yuicomboloading', 'admin'), new lang_string('configyuicomboloading', 'admin'), 1));
$setting = new admin_setting_configcheckbox('cachejs', new lang_string('cachejs', 'admin'), new lang_string('cachejs_help', 'admin'), 1);
$setting->set_updatedcallback('js_reset_all_caches');
Expand Down
2 changes: 0 additions & 2 deletions lang/en/admin.php
Expand Up @@ -390,7 +390,6 @@
For example: standard,orangewhite.';
$string['configtimezone'] = 'This is the default timezone for displaying dates - each user can override this setting in their profile. Cron tasks and other server settings are specified in this timezone. You should change the setting if it shows as "Invalid timezone"';
$string['configuseblogassociations'] = 'Should users be able to organize their blog by associating entries with courses and course modules?';
$string['configuseexternalyui'] = 'Instead of using local files, use online files available on Yahoo‘s servers. WARNING: This requires an internet connection, or no AJAX will work on your site. This setting is not compatible with sites using https.';
$string['configusesitenameforsitepages'] = 'If enabled the site\'s short name will be used for the site pages node in the navigation rather than the string \'Site pages\'.';
$string['configusetags'] = 'Should tags functionality across the site be enabled?';
$string['configvariables'] = 'Variables';
Expand Down Expand Up @@ -1509,7 +1508,6 @@
$string['upgradingversion'] = 'Upgrading to new version';
$string['upwards'] = 'upwards';
$string['useblogassociations'] = 'Enable associations';
$string['useexternalyui'] = 'Use online YUI libraries';
$string['user'] = 'User';
$string['userbulk'] = 'Bulk user actions';
$string['userbulkdownload'] = 'Export users as';
Expand Down
8 changes: 8 additions & 0 deletions lib/db/upgrade.php
Expand Up @@ -3064,5 +3064,13 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2022121600.01);
}

if ($oldversion < 2023010300.00) {
// The useexternalyui setting has been removed.
unset_config('useexternalyui');

// Main savepoint reached.
upgrade_main_savepoint(true, 2023010300.00);
}

return true;
}
17 changes: 3 additions & 14 deletions lib/outputrequirementslib.php
Expand Up @@ -180,23 +180,12 @@ public function __construct() {
$this->yui3loader = new stdClass();
$this->YUI_config = new YUI_config();

if (is_https() && !empty($CFG->useexternalyui)) {
// On HTTPS sites all JS must be loaded from https sites,
// YUI CDN does not support https yet, sorry.
$CFG->useexternalyui = 0;
}

// Set up some loader options.
$this->yui3loader->local_base = $CFG->wwwroot . '/lib/yuilib/'. $CFG->yui3version . '/';
$this->yui3loader->local_comboBase = $CFG->wwwroot . '/theme/yui_combo.php'.$sep;

if (!empty($CFG->useexternalyui)) {
$this->yui3loader->base = 'http://yui.yahooapis.com/' . $CFG->yui3version . '/';
$this->yui3loader->comboBase = 'http://yui.yahooapis.com/combo?';
} else {
$this->yui3loader->base = $this->yui3loader->local_base;
$this->yui3loader->comboBase = $this->yui3loader->local_comboBase;
}
$this->yui3loader->base = $this->yui3loader->local_base;
$this->yui3loader->comboBase = $this->yui3loader->local_comboBase;

// Enable combo loader? This significantly helps with caching and performance!
$this->yui3loader->combine = !empty($CFG->yuicomboloading);
Expand All @@ -219,7 +208,7 @@ public function __construct() {

$configname = $this->YUI_config->set_config_source('lib/yui/config/yui2.js');
$this->YUI_config->add_group('yui2', array(
// Loader configuration for our 2in3, for now ignores $CFG->useexternalyui.
// Loader configuration for our 2in3.
'base' => $CFG->wwwroot . '/lib/yuilib/2in3/' . $CFG->yui2version . '/build/',
'comboBase' => $CFG->wwwroot . '/theme/yui_combo.php'.$sep,
'combine' => $this->yui3loader->combine,
Expand Down
3 changes: 3 additions & 0 deletions lib/upgrade.txt
Expand Up @@ -14,6 +14,9 @@ information provided here is intended especially for developers.
* New DB parameter 'versionfromdb', only available for MySQL and MariaDB drivers. It allows to force the DB version to be
evaluated through an explicit call to VERSION() to skip the PHP client version which appears to be sometimes fooled by the
underlying infrastructure, e.g. PaaS on Azure.
* The useexternalyui configuration setting has been removed as a part of the migration away from YUI.
It only worked with http sites and did not officially support SSL, and is at risk of disappearing should Yahoo! decide
to remove it.

=== 4.1 ===

Expand Down
2 changes: 1 addition & 1 deletion version.php
Expand Up @@ -29,7 +29,7 @@

defined('MOODLE_INTERNAL') || die();

$version = 2022122900.00; // YYYYMMDD = weekly release date of this DEV branch.
$version = 2023010300.00; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.
$release = '4.2dev (Build: 20221229)'; // Human-friendly version name
Expand Down

0 comments on commit 1ac2eb5

Please sign in to comment.