mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Merge branch 'wip-mdl-40407' of git://github.com/rajeshtaneja/moodle
(moved a deprecation warning around to try and avoid more conflicts in upgrade.txt) Conflicts: lib/upgrade.txt
This commit is contained in:
commit
af578aec7c
@ -49,7 +49,7 @@
|
||||
// Prevent caching of this page to stop confusion when changing page after making AJAX changes
|
||||
$PAGE->set_cacheable(false);
|
||||
|
||||
preload_course_contexts($course->id);
|
||||
context_helper::preload_course($course->id);
|
||||
$context = context_course::instance($course->id, MUST_EXIST);
|
||||
|
||||
// Remove any switched roles before checking login
|
||||
|
@ -7230,19 +7230,6 @@ class context_block extends context {
|
||||
// before removing devs will be warned with a debugging message first,
|
||||
// then we will add error message and only after that we can remove the functions
|
||||
// completely.
|
||||
/**
|
||||
* Preloads all contexts relating to a course: course, modules. Block contexts
|
||||
* are no longer loaded here. The contexts for all the blocks on the current
|
||||
* page are now efficiently loaded by {@link block_manager::load_blocks()}.
|
||||
*
|
||||
* @deprecated since 2.2
|
||||
* @param int $courseid Course ID
|
||||
* @return void
|
||||
*/
|
||||
function preload_course_contexts($courseid) {
|
||||
context_helper::preload_course($courseid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Preloads context information together with instances.
|
||||
* Use context_instance_preload() to strip the context info from the record and cache the context instance.
|
||||
|
@ -5042,3 +5042,18 @@ function rebuild_contexts(array $fixcontexts) {
|
||||
}
|
||||
context_helper::build_all_paths(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Preloads all contexts relating to a course: course, modules. Block contexts
|
||||
* are no longer loaded here. The contexts for all the blocks on the current
|
||||
* page are now efficiently loaded by {@link block_manager::load_blocks()}.
|
||||
*
|
||||
* @deprecated since Moodle 2.2
|
||||
* @see context_helper::preload_course()
|
||||
* @param int $courseid Course ID
|
||||
* @return void
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
@ -288,7 +288,7 @@ class course_modinfo extends stdClass {
|
||||
}
|
||||
|
||||
// If we haven't already preloaded contexts for the course, do it now
|
||||
preload_course_contexts($course->id);
|
||||
context_helper::preload_course($course->id);
|
||||
|
||||
// Loop through each piece of module data, constructing it
|
||||
$modexists = array();
|
||||
|
@ -2422,6 +2422,7 @@ class accesslib_testcase extends advanced_testcase {
|
||||
|
||||
context_helper::reset_caches();
|
||||
preload_course_contexts($SITE->id);
|
||||
$this->assertDebuggingCalled('preload_course_contexts() is deprecated, please use context_helper::preload_course() instead.', DEBUG_DEVELOPER);
|
||||
$this->assertEquals(1 + $DB->count_records('course_modules', array('course' => $SITE->id)),
|
||||
context_inspection::test_context_cache_size());
|
||||
|
||||
|
@ -5,6 +5,7 @@ information provided here is intended especially for developers.
|
||||
|
||||
* Use new core_component::* plugin listing and component normalisation methods.
|
||||
* Use core_text::* instead of textlib:: and also core_collator::* instead of collatorlib::*.
|
||||
* Use new function moodleform::mock_submit() to simulate form submission in unit tests (backported).
|
||||
* get_context_instance() is deprecated, please use use context_xxxx::instance().
|
||||
* get_context_instance_by_id() is deprecated, please use context::instance_by_id($id).
|
||||
* load_temp_role() and remove_temp_roles() can not be used any more.
|
||||
@ -16,7 +17,7 @@ information provided here is intended especially for developers.
|
||||
* cleanup_contexts() is deprecated, please use context_helper::cleanup_instances().
|
||||
* build_context_path() is deprecated, please use context_helper::build_all_paths().
|
||||
* rebuild_contexts() is deprecated, please use $context->reset_paths().
|
||||
* Use new function moodleform::mock_submit() to simulate form submission in unit tests (backported).
|
||||
* preload_course_contexts() is deprecated, please use context_helper::preload_course().
|
||||
|
||||
=== 2.5.1 ===
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user