Skip to content

Commit

Permalink
MDL-72615 core: Remove boxnet portfolio and repository
Browse files Browse the repository at this point in the history
  • Loading branch information
cescobedo committed Oct 27, 2021
1 parent 2b2897b commit 0a5d387
Show file tree
Hide file tree
Showing 27 changed files with 57 additions and 1,612 deletions.
2 changes: 1 addition & 1 deletion backup/moodle2/restore_stepslib.php
Expand Up @@ -5378,7 +5378,7 @@ protected function define_execution() {
}

} else {
// This is a reference to some external file such as in boxnet or dropbox.
// This is a reference to some external file such as dropbox.
// If we are restoring to the same site, keep the reference untouched and
// restore the alias as is.
if ($this->task->is_samesite()) {
Expand Down
268 changes: 0 additions & 268 deletions lib/boxlib.php

This file was deleted.

8 changes: 4 additions & 4 deletions lib/classes/plugin_manager.php
Expand Up @@ -1733,12 +1733,12 @@ public static function is_deleted_standard_plugin($type, $name) {
'enrol' => array('authorize'),
'filter' => array('censor'),
'media' => array('swf'),
'portfolio' => array('picasa'),
'portfolio' => array('picasa', 'boxnet'),
'qformat' => array('webct'),
'message' => array('jabber'),
'quizaccess' => array('safebrowser'),
'report' => array('search'),
'repository' => array('alfresco', 'picasa', 'skydrive'),
'repository' => array('alfresco', 'picasa', 'skydrive', 'boxnet'),
'tinymce' => array('dragmath'),
'tool' => array('bloglevelupgrade', 'qeupgradehelper', 'timezoneimport', 'assignmentupgrade', 'health'),
'theme' => array('bootstrapbase', 'clean', 'more', 'afterburner', 'anomaly', 'arialist', 'base',
Expand Down Expand Up @@ -1942,7 +1942,7 @@ public static function standard_plugins_list($type) {
),

'portfolio' => array(
'boxnet', 'download', 'flickr', 'googledocs', 'mahara'
'download', 'flickr', 'googledocs', 'mahara'
),

'profilefield' => array(
Expand Down Expand Up @@ -2002,7 +2002,7 @@ public static function standard_plugins_list($type) {
),

'repository' => array(
'areafiles', 'boxnet', 'contentbank', 'coursefiles', 'dropbox', 'equella', 'filesystem',
'areafiles', 'contentbank', 'coursefiles', 'dropbox', 'equella', 'filesystem',
'flickr', 'flickr_public', 'googledocs', 'local', 'merlot', 'nextcloud',
'onedrive', 'recent', 's3', 'upload', 'url', 'user', 'webdav',
'wikimedia', 'youtube'
Expand Down
43 changes: 43 additions & 0 deletions lib/db/upgrade.php
Expand Up @@ -3010,5 +3010,48 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2021101900.01);
}

if ($oldversion < 2021102600.01) {
// If portfolio_boxnet is no longer present, remove it.
if (!file_exists($CFG->dirroot . '/portfolio/boxnet/version.php')) {
$instance = $DB->get_record('portfolio_instance', ['plugin' => 'boxnet']);
if (!empty($instance)) {
// Remove all records from portfolio_instance_config.
$DB->delete_records('portfolio_instance_config', ['instance' => $instance->id]);
// Remove all records from portfolio_instance_user.
$DB->delete_records('portfolio_instance_user', ['instance' => $instance->id]);
// Remove all records from portfolio_log.
$DB->delete_records('portfolio_log', ['portfolio' => $instance->id]);
// Remove all records from portfolio_tempdata.
$DB->delete_records('portfolio_tempdata', ['instance' => $instance->id]);
// Remove the record from the portfolio_instance table.
$DB->delete_records('portfolio_instance', ['id' => $instance->id]);
}

// Clean config.
unset_all_config_for_plugin('portfolio_boxnet');
}

// If repository_boxnet is no longer present, remove it.
if (!file_exists($CFG->dirroot . '/repository/boxnet/version.php')) {
$instance = $DB->get_record('repository', ['type' => 'boxnet']);
if (!empty($instance)) {
// Remove all records from repository_instance_config table.
$DB->delete_records('repository_instance_config', ['instanceid' => $instance->id]);
// Remove all records from repository_instances table.
$DB->delete_records('repository_instances', ['typeid' => $instance->id]);
// Remove the record from the repository table.
$DB->delete_records('repository', ['id' => $instance->id]);
}

// Clean config.
unset_all_config_for_plugin('repository_boxnet');

// Remove orphaned files.
upgrade_delete_orphaned_file_records();
}

upgrade_main_savepoint(true, 2021102600.01);
}

return true;
}
4 changes: 2 additions & 2 deletions lib/portfolio/plugin.php
Expand Up @@ -208,7 +208,7 @@ public function user_config_validation(array $data) {}
* Eg: things that your subclasses want to keep in state
* across the export.
* Keys must be in get_allowed_export_config
* This is deliberately not final (see boxnet plugin)
* This is deliberately not final (see googledocs plugin)
* @see get_allowed_export_config
*
* @param array $config named array of config items to set.
Expand Down Expand Up @@ -402,7 +402,7 @@ public function steal_control($stage) {
* and the request (get and post but not cookie) parameters.
* This is useful for external systems that need to redirect the user back
* with some extra data in the url (like auth tokens etc)
* for an example implementation, see boxnet portfolio plugin.
* for an example implementation, see googledocs portfolio plugin.
*
* @param int $stage the stage before control was stolen
* @param array $params a merge of $_GET and $_POST
Expand Down
1 change: 1 addition & 0 deletions lib/upgrade.txt
Expand Up @@ -2,6 +2,7 @@ This files describes API changes in core libraries and APIs,
information provided here is intended especially for developers.

=== 4.0 ===
* Since Boxnet has been remove from core then boxnet_client() class has been removed from core too.
* New navigation classes to mimic the new navigation project. The existing navigation callbacks are still available and
will be called. The following behaviour will be the new standard for nodes added via callbacks:
- Module nodes added will be appended to the end and will appear within the hamburger option.
Expand Down

0 comments on commit 0a5d387

Please sign in to comment.