Merge branch 'wip-mdl-35009' of git://github.com/rajeshtaneja/moodle
Conflicts: lib/accesslib.php lib/deprecatedlib.php lib/upgrade.txt
This commit is contained in:
@@ -7265,19 +7265,6 @@ function get_system_context($cache = true) {
|
||||
return context_system::instance(0, IGNORE_MISSING, $cache);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a context instance as an object, from a given context id.
|
||||
*
|
||||
* @deprecated since 2.2, use context::instance_by_id($id) instead
|
||||
* @param int $id context id
|
||||
* @param int $strictness IGNORE_MISSING means compatible mode, false returned if record not found, debug message if more found;
|
||||
* MUST_EXIST means throw exception if no record or multiple records found
|
||||
* @return context|bool the context object or false if not found.
|
||||
*/
|
||||
function get_context_instance_by_id($id, $strictness = IGNORE_MISSING) {
|
||||
return context::instance_by_id($id, $strictness);
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursive function which, given a context, find all parent context ids,
|
||||
* and return the array in reverse order, i.e. parent first, then grand
|
||||
|
||||
@@ -4883,3 +4883,19 @@ function get_context_instance($contextlevel, $instance = 0, $strictness = IGNORE
|
||||
return $contexts[$instance];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a context instance as an object, from a given context id.
|
||||
*
|
||||
* @deprecated since Moodle 2.2 MDL-35009 - please do not use this function any more.
|
||||
* @todo MDL-34550 This will be deleted in Moodle 2.8
|
||||
* @see context::instance_by_id($id)
|
||||
* @param int $id context id
|
||||
* @param int $strictness IGNORE_MISSING means compatible mode, false returned if record not found, debug message if more found;
|
||||
* MUST_EXIST means throw exception if no record or multiple records found
|
||||
* @return context|bool the context object or false if not found.
|
||||
*/
|
||||
function get_context_instance_by_id($id, $strictness = IGNORE_MISSING) {
|
||||
debugging('Function get_context_instance_by_id() is deprecated, please use context::instance_by_id($id) instead', DEBUG_DEVELOPER);
|
||||
return context::instance_by_id($id, $strictness);
|
||||
}
|
||||
|
||||
@@ -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::*.
|
||||
* get_context_instance() now throws deprecated warning.
|
||||
* get_context_instance_by_id() is deprecated, please use context::instance_by_id($id)
|
||||
|
||||
=== 2.5.1 ===
|
||||
|
||||
|
||||
Reference in New Issue
Block a user