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 $baseurl the name of the script calling this funciton. For examle 'qusetion/edit.php'.
|
||||||
* @param string $edittab code for this edit tab
|
* @param string $edittab code for this edit tab
|
||||||
* @param bool $requirecmid require cmid? default false
|
* @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
|
* @return array $thispageurl, $contexts, $cmid, $cm, $module, $pagevars
|
||||||
*/
|
*/
|
||||||
function question_edit_setup($edittab, $baseurl, $requirecmid = false, $requirecourseid = true) {
|
function question_edit_setup($edittab, $baseurl, $requirecmid = false, $unused = null) {
|
||||||
global $DB, $PAGE;
|
global $DB, $PAGE, $CFG;
|
||||||
|
|
||||||
|
if ($unused !== null) {
|
||||||
|
debugging('Deprecated argument passed to question_edit_setup()', DEBUG_DEVELOPER);
|
||||||
|
}
|
||||||
|
|
||||||
$thispageurl = new moodle_url($baseurl);
|
$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.
|
$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 {
|
} else {
|
||||||
$module = null;
|
$module = null;
|
||||||
$cm = null;
|
$cm = null;
|
||||||
if ($requirecourseid){
|
$courseid = required_param('courseid', PARAM_INT);
|
||||||
$courseid = required_param('courseid', PARAM_INT);
|
$thispageurl->params(compact('courseid'));
|
||||||
} else {
|
require_login($courseid, false);
|
||||||
$courseid = optional_param('courseid', 0, PARAM_INT);
|
$thiscontext = context_course::instance($courseid);
|
||||||
}
|
|
||||||
if ($courseid){
|
|
||||||
$thispageurl->params(compact('courseid'));
|
|
||||||
require_login($courseid, false);
|
|
||||||
$thiscontext = context_course::instance($courseid);
|
|
||||||
} else {
|
|
||||||
$thiscontext = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($thiscontext){
|
if ($thiscontext){
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
This files describes API changes for code that uses the question API.
|
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 ===
|
=== 2.9 ===
|
||||||
|
|
||||||
1) Some functions in questionlib.php which were deprecated in the past have now
|
1) Some functions in questionlib.php which were deprecated in the past have now
|
||||||
|
Loading…
x
Reference in New Issue
Block a user