mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Merge branch 'MDL-77927-master' of https://github.com/stevandoMoodle/moodle
This commit is contained in:
commit
19022cd940
@ -4110,9 +4110,6 @@
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_xmlrpc_usage" level="optional">
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mod_assignment" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="modassignmentinuse" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
</CUSTOM_CHECKS>
|
||||
</MOODLE>
|
||||
|
@ -1586,7 +1586,7 @@ $string['yuicomboloading'] = 'YUI combo loading';
|
||||
$string['ziprequired'] = 'The Zip PHP extension is now required by Moodle, info-ZIP binaries or PclZip library are not used anymore.';
|
||||
$string['manageqbanks'] = 'Manage question bank plugins';
|
||||
$string['modassignmentinuse'] = 'Your site is still using the Assignment 2.2 plugin. Before upgrading you must 1) backup any Assignment 2.2 activities that you want to keep and restore them as Assignment activities, and 2) delete all Assignment 2.2 data from the database.';
|
||||
|
||||
$string['modassignmentsubpluginsexist'] = 'Assignment 2.2. subplugins may be present. The mod/assignment folder and all of its subplugins need to be removed before upgrading.';
|
||||
|
||||
$string['caching'] = 'Caching';
|
||||
$string['cachesettings'] = 'Cache settings';
|
||||
|
@ -3191,20 +3191,6 @@ privatefiles,moodle|/user/files.php';
|
||||
upgrade_main_savepoint(true, 2023031400.02);
|
||||
}
|
||||
|
||||
if ($oldversion < 2023032800.01) {
|
||||
// If mod_assignment is no longer present, remove it.
|
||||
if (!file_exists($CFG->dirroot . '/mod/assignment/version.php')) {
|
||||
uninstall_plugin('assignment', 'offline');
|
||||
uninstall_plugin('assignment', 'online');
|
||||
uninstall_plugin('assignment', 'upload');
|
||||
uninstall_plugin('assignment', 'uploadsingle');
|
||||
uninstall_plugin('mod', 'assignment');
|
||||
}
|
||||
|
||||
// Main savepoint reached.
|
||||
upgrade_main_savepoint(true, 2023032800.01);
|
||||
}
|
||||
|
||||
if ($oldversion < 2023040600.01) {
|
||||
// If logstore_legacy is no longer present, remove it.
|
||||
if (!file_exists($CFG->dirroot . '/admin/tool/log/store/legacy/version.php')) {
|
||||
@ -3228,5 +3214,47 @@ privatefiles,moodle|/user/files.php';
|
||||
upgrade_main_savepoint(true, 2023041100.00);
|
||||
}
|
||||
|
||||
if ($oldversion < 2023042000.00) {
|
||||
// If mod_assignment is no longer present, remove it.
|
||||
if (!file_exists($CFG->dirroot . '/mod/assignment/version.php')) {
|
||||
// Delete all mod_assignment grade_grades orphaned data.
|
||||
$DB->delete_records_select(
|
||||
'grade_grades', "itemid IN (SELECT id FROM {grade_items} WHERE itemtype = 'mod' AND itemmodule = 'assignment')"
|
||||
);
|
||||
|
||||
// Delete all mod_assignment grade_grades_history orphaned data.
|
||||
$DB->delete_records('grade_grades_history', ['source' => 'mod/assignment']);
|
||||
|
||||
// Delete all mod_assignment grade_items orphaned data.
|
||||
$DB->delete_records('grade_items', ['itemtype' => 'mod', 'itemmodule' => 'assignment']);
|
||||
|
||||
// Delete all mod_assignment grade_items_history orphaned data.
|
||||
$DB->delete_records('grade_items_history', ['itemtype' => 'mod', 'itemmodule' => 'assignment']);
|
||||
|
||||
// Delete core mod_assignment subplugins.
|
||||
uninstall_plugin('assignment', 'offline');
|
||||
uninstall_plugin('assignment', 'online');
|
||||
uninstall_plugin('assignment', 'upload');
|
||||
uninstall_plugin('assignment', 'uploadsingle');
|
||||
|
||||
// Delete other mod_assignment subplugins.
|
||||
$pluginnamelike = $DB->sql_like('plugin', ':pluginname');
|
||||
$subplugins = $DB->get_fieldset_select('config_plugins', 'plugin', "$pluginnamelike AND name = :name", [
|
||||
'pluginname' => $DB->sql_like_escape('assignment_') . '%',
|
||||
'name' => 'version',
|
||||
]);
|
||||
foreach ($subplugins as $subplugin) {
|
||||
[$plugin, $subpluginname] = explode('_', $subplugin, 2);
|
||||
uninstall_plugin($plugin, $subpluginname);
|
||||
}
|
||||
|
||||
// Delete mod_assignment.
|
||||
uninstall_plugin('mod', 'assignment');
|
||||
}
|
||||
|
||||
// Main savepoint reached.
|
||||
upgrade_main_savepoint(true, 2023042000.00);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -2824,12 +2824,20 @@ function check_xmlrpc_usage(environment_results $result): ?environment_results {
|
||||
function check_mod_assignment(environment_results $result): ?environment_results {
|
||||
global $CFG, $DB;
|
||||
|
||||
// Check the number of records.
|
||||
if (!file_exists("{$CFG->dirroot}/mod/assignment/version.php") && $DB->get_manager()->table_exists('assignment')
|
||||
&& $DB->count_records('assignment') > 0) {
|
||||
$result->setInfo('Assignment 2.2 is in use');
|
||||
$result->setFeedbackStr('modassignmentinuse');
|
||||
return $result;
|
||||
if (!file_exists("{$CFG->dirroot}/mod/assignment/version.php")) {
|
||||
// Check for mod_assignment instances.
|
||||
if ($DB->get_manager()->table_exists('assignment') && $DB->count_records('assignment') > 0) {
|
||||
$result->setInfo('Assignment 2.2 is in use');
|
||||
$result->setFeedbackStr('modassignmentinuse');
|
||||
return $result;
|
||||
}
|
||||
|
||||
// Check for mod_assignment subplugins.
|
||||
if (is_dir($CFG->dirroot . '/mod/assignment/type')) {
|
||||
$result->setInfo('Assignment 2.2 subplugins present');
|
||||
$result->setFeedbackStr('modassignmentsubpluginsexist');
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$version = 2023041900.00; // YYYYMMDD = weekly release date of this DEV branch.
|
||||
$version = 2023042000.00; // YYYYMMDD = weekly release date of this DEV branch.
|
||||
// RR = release increments - 00 in DEV branches.
|
||||
// .XX = incremental changes.
|
||||
$release = '4.2rc1 (Build: 20230418)'; // Human-friendly version name
|
||||
|
Loading…
x
Reference in New Issue
Block a user