diff --git a/course/lib.php b/course/lib.php index 9f2bb262b71..eab20cf3ef6 100644 --- a/course/lib.php +++ b/course/lib.php @@ -2036,7 +2036,7 @@ function move_courses($courseids, $categoryid) { add_to_log($course->id, "course", "move", "edit.php?id=$course->id", $course->id); $context = context_course::instance($course->id); - context_moved($context, $newparent); + $context->update_moved($newparent); } } fix_course_sortorder(); @@ -2353,7 +2353,7 @@ function update_course($data, $editoroptions = NULL) { if ($movecat) { $newparent = context_coursecat::instance($course->category); - context_moved($context, $newparent); + $context->update_moved($newparent); } fix_course_sortorder(); diff --git a/lib/accesslib.php b/lib/accesslib.php index 0617c575b88..28ddcb9062f 100644 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -7291,26 +7291,6 @@ function mark_context_dirty($path) { } } -/** - * Update the path field of the context and all dep. subcontexts that follow - * - * Update the path field of the context and - * all the dependent subcontexts that follow - * the move. - * - * The most important thing here is to be as - * DB efficient as possible. This op can have a - * massive impact in the DB. - * - * @deprecated since 2.2 - * @param context $context context obj - * @param context $newparent new parent obj - * @return void - */ -function context_moved(context $context, context $newparent) { - $context->update_moved($newparent); -} - /** * Remove a context record and any dependent entries, * removes context from static context cache too diff --git a/lib/deprecatedlib.php b/lib/deprecatedlib.php index 2ee977fa7a8..884c8095797 100644 --- a/lib/deprecatedlib.php +++ b/lib/deprecatedlib.php @@ -5057,3 +5057,25 @@ function preload_course_contexts($courseid) { debugging('preload_course_contexts() is deprecated, please use context_helper::preload_course() instead.', DEBUG_DEVELOPER); context_helper::preload_course($courseid); } + +/** + * Update the path field of the context and all dep. subcontexts that follow + * + * Update the path field of the context and + * all the dependent subcontexts that follow + * the move. + * + * The most important thing here is to be as + * DB efficient as possible. This op can have a + * massive impact in the DB. + * + * @deprecated since Moodle 2.2 + * @see context::update_moved() + * @param context $context context obj + * @param context $newparent new parent obj + * @return void + */ +function context_moved(context $context, context $newparent) { + debugging('context_moved() is deprecated, please use context::update_moved() instead.', DEBUG_DEVELOPER); + $context->update_moved($newparent); +} \ No newline at end of file diff --git a/lib/tests/accesslib_test.php b/lib/tests/accesslib_test.php index d6532c84282..a6cec468376 100644 --- a/lib/tests/accesslib_test.php +++ b/lib/tests/accesslib_test.php @@ -2453,6 +2453,7 @@ class accesslib_testcase extends advanced_testcase { $course->category = $miscid; $DB->update_record('course', $course); context_moved($context, $categorycontext); + $this->assertDebuggingCalled('context_moved() is deprecated, please use context::update_moved() instead.', DEBUG_DEVELOPER); $context = context_course::instance($course->id); $this->assertEquals($context->get_parent_context(), $categorycontext); diff --git a/lib/upgrade.txt b/lib/upgrade.txt index e8a3de9d091..74cf9d2e94a 100644 --- a/lib/upgrade.txt +++ b/lib/upgrade.txt @@ -17,6 +17,7 @@ information provided here is intended especially for developers. * build_context_path() is deprecated, please use context_helper::build_all_paths(). * rebuild_contexts() is deprecated, please use $context->reset_paths(). * preload_course_contexts() is deprecated, please use context_helper::preload_course(). +* context_moved() is deprecated, please use context::update_moved(). === 2.5.1 ===