Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'MDL-42767-24' of git://github.com/ankitagarwal/moodle i…

…nto MOODLE_24_STABLE
  • Loading branch information...
commit c5776576008e166b8659dc5c417193b022ff9e9b 2 parents 5ba78ea + 34f1a73
@marinaglancy marinaglancy authored
Showing with 19 additions and 1 deletion.
  1. +14 −0 lib/db/upgrade.php
  2. +4 −0 lib/moodlelib.php
  3. +1 −1  version.php
View
14 lib/db/upgrade.php
@@ -1849,5 +1849,19 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2012120306.09);
}
+ if ($oldversion < 2012120307.02) {
+
+ // Delete notes of deleted courses.
+ $sql = "DELETE FROM {post}
+ WHERE NOT EXISTS (SELECT {course}.id FROM {course}
+ WHERE {course}.id = {post}.courseid)
+ AND {post}.module = ?";
+ $DB->execute($sql, array('notes'));
+
+ // Main savepoint reached.
+ upgrade_main_savepoint(true, 2012120307.02);
+ }
+
+
return true;
}
View
4 lib/moodlelib.php
@@ -4624,6 +4624,7 @@ function remove_course_contents($courseid, $showfeedback = true, array $options
require_once($CFG->dirroot.'/tag/coursetagslib.php');
require_once($CFG->dirroot.'/comment/lib.php');
require_once($CFG->dirroot.'/rating/lib.php');
+ require_once($CFG->dirroot.'/notes/lib.php');
// NOTE: these concatenated strings are suboptimal, but it is just extra info...
$strdeleted = get_string('deleted').' - ';
@@ -4783,6 +4784,9 @@ function remove_course_contents($courseid, $showfeedback = true, array $options
// filters be gone!
filter_delete_all_for_context($coursecontext->id);
+ // Notes, you shall not pass!
+ note_delete_all($course->id);
+
// die comments!
comment::delete_comments($coursecontext->id);
View
2  version.php
@@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
-$version = 2012120307.01; // 20121203 = branching date YYYYMMDD - do not modify!
+$version = 2012120307.02; // 20121203 = branching date YYYYMMDD - do not modify!
// RR = release increments - 00 in DEV branches
// .XX = incremental changes
Please sign in to comment.
Something went wrong with that request. Please try again.