Merge branch 'MDL-42666-25-fixup' of git://github.com/FMCorz/moodle into MOODLE_25_STABLE

This commit is contained in:
Dan Poltawski
2013-11-07 15:56:31 +08:00
2 changed files with 23 additions and 17 deletions
+22 -16
View File
@@ -41,28 +41,34 @@ function xmldb_repository_boxnet_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2013050101, 'repository', 'boxnet');
}
if ($oldversion < 2013050102) {
if ($oldversion < 2013050103) {
require_once($CFG->dirroot . '/repository/lib.php');
require_once($CFG->dirroot . '/repository/boxnet/db/upgradelib.php');
$params = array();
$params['context'] = array();
$params['onlyvisible'] = false;
$params['type'] = 'boxnet';
$instances = repository::get_instances($params);
$clientid = get_config('boxnet', 'clientid');
$clientsecret = get_config('boxnet', 'clientsecret');
// Notify the admin about the migration process if they are using the repo.
if (!empty($instances)) {
repository_boxnet_admin_upgrade_notification();
// Only proceed if the repository hasn't been set for APIv2 yet.
if ($clientid === false && $clientsecret === false) {
$params = array();
$params['context'] = array();
$params['onlyvisible'] = false;
$params['type'] = 'boxnet';
$instances = repository::get_instances($params);
// Notify the admin about the migration process if they are using the repo.
if (!empty($instances)) {
repository_boxnet_admin_upgrade_notification();
}
// Hide the repository.
$repositorytype = repository::get_type_by_typename('boxnet');
if (!empty($repositorytype)) {
$repositorytype->update_visibility(false);
}
}
// Hide the repository.
$repositorytype = repository::get_type_by_typename('boxnet');
if (!empty($repositorytype)) {
$repositorytype->update_visibility(false);
}
upgrade_plugin_savepoint(true, 2013050102, 'repository', 'boxnet');
upgrade_plugin_savepoint(true, 2013050103, 'repository', 'boxnet');
}
return true;
+1 -1
View File
@@ -26,6 +26,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2013050102; // The current plugin version (Date: YYYYMMDDXX)
$plugin->version = 2013050103; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2013050100; // Requires this Moodle version
$plugin->component = 'repository_boxnet'; // Full name of the plugin (used for diagnostics)