mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-48004 question: remove buggy arg of question_edit_setup
There are no uses of this in core and it does not make sense
This commit is contained in:
parent
4dc29f5e8d
commit
5aeba19926
@ -260,11 +260,15 @@ class_alias('core_question\bank\view', 'question_bank_view', true);
|
||||
* @param string $baseurl the name of the script calling this funciton. For examle 'qusetion/edit.php'.
|
||||
* @param string $edittab code for this edit tab
|
||||
* @param bool $requirecmid require cmid? default false
|
||||
* @param bool $requirecourseid require courseid, if cmid is not given? default true
|
||||
* @param bool $unused no longer used, do no pass
|
||||
* @return array $thispageurl, $contexts, $cmid, $cm, $module, $pagevars
|
||||
*/
|
||||
function question_edit_setup($edittab, $baseurl, $requirecmid = false, $requirecourseid = true) {
|
||||
global $DB, $PAGE;
|
||||
function question_edit_setup($edittab, $baseurl, $requirecmid = false, $unused = null) {
|
||||
global $DB, $PAGE, $CFG;
|
||||
|
||||
if ($unused !== null) {
|
||||
debugging('Deprecated argument passed to question_edit_setup()', DEBUG_DEVELOPER);
|
||||
}
|
||||
|
||||
$thispageurl = new moodle_url($baseurl);
|
||||
$thispageurl->remove_all_params(); // We are going to explicity add back everything important - this avoids unwanted params from being retained.
|
||||
@ -283,18 +287,10 @@ function question_edit_setup($edittab, $baseurl, $requirecmid = false, $requirec
|
||||
} else {
|
||||
$module = null;
|
||||
$cm = null;
|
||||
if ($requirecourseid){
|
||||
$courseid = required_param('courseid', PARAM_INT);
|
||||
} else {
|
||||
$courseid = optional_param('courseid', 0, PARAM_INT);
|
||||
}
|
||||
if ($courseid){
|
||||
$thispageurl->params(compact('courseid'));
|
||||
require_login($courseid, false);
|
||||
$thiscontext = context_course::instance($courseid);
|
||||
} else {
|
||||
$thiscontext = null;
|
||||
}
|
||||
$courseid = required_param('courseid', PARAM_INT);
|
||||
$thispageurl->params(compact('courseid'));
|
||||
require_login($courseid, false);
|
||||
$thiscontext = context_course::instance($courseid);
|
||||
}
|
||||
|
||||
if ($thiscontext){
|
||||
|
@ -1,5 +1,11 @@
|
||||
This files describes API changes for code that uses the question API.
|
||||
|
||||
=== 3.1 ===
|
||||
|
||||
1) The argument $requirecourseid was removed from question_edit_setup() and
|
||||
is no longer respected. The behaviour was found to be buggy and now throws
|
||||
debugging notices if passed.
|
||||
|
||||
=== 2.9 ===
|
||||
|
||||
1) Some functions in questionlib.php which were deprecated in the past have now
|
||||
|
Loading…
x
Reference in New Issue
Block a user