mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Merge branch 'MDL-75752' of https://github.com/timhunt/moodle
This commit is contained in:
commit
29e1f713b6
@ -46,10 +46,13 @@ class backup_qbank_comment_plugin extends \backup_qbank_plugin {
|
||||
$pluginwrapper->add_child($comments);
|
||||
$comments->add_child($comment);
|
||||
|
||||
// Trying to pass an param (contextid) with an int value seems to have special meaning, so just inline.
|
||||
// It is an int, so minimal security risk.
|
||||
$comment->set_source_sql("SELECT c.*
|
||||
FROM {comments} c
|
||||
WHERE c.commentarea = 'question'
|
||||
WHERE c.contextid = " . context_system::instance()->id . "
|
||||
AND c.component = 'qbank_comment'
|
||||
AND c.commentarea = 'question'
|
||||
AND c.itemid = ?", [backup::VAR_PARENTID]);
|
||||
|
||||
$comment->annotate_ids('user', 'userid');
|
||||
|
@ -152,9 +152,8 @@ class backup_test extends \advanced_testcase {
|
||||
$question2 = $this->qgen->create_question('shortanswer', null, $this->question2data);
|
||||
|
||||
// Add comments to the questions.
|
||||
$coursecontext = \context_course::instance($this->course->id);
|
||||
$args = new \stdClass;
|
||||
$args->context = $coursecontext;
|
||||
$args->context = \context_system::instance();
|
||||
$args->course = $this->course;
|
||||
$args->area = 'question';
|
||||
$args->itemid = $question1->id;
|
||||
|
Loading…
x
Reference in New Issue
Block a user