Skip to content

Commit

Permalink
Merge branch 'MDL-75168-311' of https://github.com/paulholden/moodle
Browse files Browse the repository at this point in the history
…into MOODLE_311_STABLE
  • Loading branch information
andrewnicols committed Sep 27, 2022
2 parents d51a147 + 10d39a1 commit b193122
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
11 changes: 11 additions & 0 deletions lib/db/upgrade.php
Expand Up @@ -2720,5 +2720,16 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2021051707.05);
}

if ($oldversion < 2021051710.03) {

// Remove any orphaned tag instance records (pointing to non-existing context).
$DB->delete_records_select('tag_instance', 'NOT EXISTS (
SELECT ctx.id FROM {context} ctx WHERE ctx.id = {tag_instance}.contextid
)');

// Main savepoint reached.
upgrade_main_savepoint(true, 2021051710.03);
}

return true;
}
4 changes: 4 additions & 0 deletions lib/moodlelib.php
Expand Up @@ -5151,6 +5151,10 @@ function remove_course_contents($courseid, $showfeedback = true, array $options
question_delete_activity($cm);
// Notify the competency subsystem.
\core_competency\api::hook_course_module_deleted($cm);

// Delete all tag instances associated with the instance of this module.
core_tag_tag::delete_instances("mod_{$modname}", null, context_module::instance($cm->id)->id);
core_tag_tag::remove_all_item_tags('core', 'course_modules', $cm->id);
}
if (function_exists($moddelete)) {
// This purges all module data in related tables, extra user prefs, settings, etc.
Expand Down
2 changes: 1 addition & 1 deletion version.php
Expand Up @@ -29,7 +29,7 @@

defined('MOODLE_INTERNAL') || die();

$version = 2021051710.02; // 20210517 = branching date YYYYMMDD - do not modify!
$version = 2021051710.03; // 20210517 = branching date YYYYMMDD - do not modify!
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.
$release = '3.11.10+ (Build: 20220922)';// Human-friendly version name
Expand Down

0 comments on commit b193122

Please sign in to comment.