Skip to content

Commit

Permalink
MDL-77927 core: Delete other mod_assignment subplugins
Browse files Browse the repository at this point in the history
Non-core mod_assignment subplugin data may still be present on the
database. We need to make sure to remove these too during upgrade.
  • Loading branch information
junpataleta authored and stevandoMoodle committed Apr 21, 2023
1 parent 0720524 commit 4bf6bb3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3237,6 +3237,17 @@ function xmldb_main_upgrade($oldversion) {
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');
}
Expand Down

0 comments on commit 4bf6bb3

Please sign in to comment.