MDL-72348 repository: Deprecate import from skydrive repo

The repository_skydrive has been removed from core. Methods for
importing files from skydrive to onedrive repository have been
deprecated and will be completely removed in Moodle 4.4.
This commit is contained in:
Sara Arjona 2021-09-20 16:45:41 +02:00
parent 70e6deacee
commit f02de69971
3 changed files with 13 additions and 1 deletions

View File

@ -42,7 +42,7 @@ $string['pluginname'] = 'Microsoft OneDrive';
$string['removetempaccesstask'] = 'Remove temporary write access from controlled links';
$string['searchfor'] = 'Search for {$a}';
$string['servicenotenabled'] = 'Access not configured.';
$string['skydrivefilesexist'] = 'Files found in the Microsoft SkyDrive repository. This repository has been deprecated by Microsoft, however the files may be imported to the Microsoft OneDrive repository.';
$string['skydrivefilesexist'] = 'The Microsoft SkyDrive repository is enabled but it has been deprecated, however, the files may be imported to the Microsoft OneDrive repository. If you haven\'t migrated the files from the SkyDrive repository yet, please migrate them before upgrading to Moodle 4.4, because by then it will not be possible to import them so they will be completely lost.';
$string['skydrivefilesimported'] = 'All files were imported from the Microsoft SkyDrive repository.';
$string['skydrivefilesnotimported'] = 'Some files could not be imported from the Microsoft SkyDrive repository.';
$string['onedrive:view'] = 'View OneDrive repository';

View File

@ -1008,6 +1008,8 @@ class repository_onedrive extends repository {
* Return true if any instances of the skydrive repo exist - and we can import them.
*
* @return bool
* @deprecated since Moodle 4.0
* @todo MDL-72620 This will be deleted in Moodle 4.4.
*/
public static function can_import_skydrive_files() {
global $DB;
@ -1046,10 +1048,15 @@ class repository_onedrive extends repository {
* Import all the files that were created with the skydrive repo to this repo.
*
* @return bool
* @deprecated since Moodle 4.0
* @todo MDL-72620 This will be deleted in Moodle 4.4.
*/
public static function import_skydrive_files() {
global $DB;
debugging('import_skydrive_files() is deprecated. Please migrate your files from repository_skydrive to ' .
'repository_onedrive before it will be completely removed.', DEBUG_DEVELOPER);
if (!self::can_import_skydrive_files()) {
return false;
}
@ -1090,6 +1097,9 @@ class repository_onedrive extends repository {
$mform->addElement('static', null, '', get_string('oauth2serviceslink', 'repository_onedrive', $url));
if (self::can_import_skydrive_files()) {
debugging('can_import_skydrive_files() is deprecated. Please migrate your files from repository_skydrive to ' .
'repository_onedrive before it will be completely removed.', DEBUG_DEVELOPER);
$notice = get_string('skydrivefilesexist', 'repository_onedrive');
$url = new moodle_url('/repository/onedrive/importskydrive.php');
$attrs = ['class' => 'btn btn-primary'];

View File

@ -7,6 +7,8 @@ http://docs.moodle.org/dev/Repository_API
* The repository_picasa has been completely removed (Picasa is discontinued since 2016).
* The skydrive repository has been completely removed from core. It has been moved to the plugins database repository, so
it can still be installed as a third-party plugin.
* Methods can_import_skydrive_files() and import_skydrive_files have been deprecated from repository_onedrive. The feature For
importing files from repository_skydrive to repository_onedrive will be completely removed in Moodle 4.4.
=== 3.11 ===
* The Google Drive repository now includes a new rest API function 'shared_drives_list', which can be used to fetch