MDL-32450 upgrade: do not remove DragMath settings if the files still exist

This commit is contained in:
Mark Nelson 2014-06-18 18:54:44 -07:00
parent 1170df12a1
commit e3e4ea97ff

View File

@ -3677,9 +3677,12 @@ function xmldb_main_upgrade($oldversion) {
}
if ($oldversion < 2014062600.01) {
// Purge DragMath plugin which is incompatible with GNU GPL license.
// Hacky emulation of plugin uninstallation.
unset_all_config_for_plugin('tinymce_dragmath');
// We only want to delete DragMath if the directory no longer exists. If the directory
// is present then it means it has been restored, so do not perform the uninstall.
if (!check_dir_exists($CFG->libdir . '/editor/tinymce/plugins/dragmath', false)) {
// Purge DragMath plugin which is incompatible with GNU GPL license.
unset_all_config_for_plugin('tinymce_dragmath');
}
// Main savepoint reached.
upgrade_main_savepoint(true, 2014062600.01);