MDL-40427 Libraries: Deprecated context_moved in favor of context::update_moved()
This commit is contained in:
+2
-2
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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 ===
|
||||
|
||||
|
||||
Reference in New Issue
Block a user