Skip to content

Commit

Permalink
MDL-52811 course: moodle/course:setforcedlanguage integration fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
davosmith committed Feb 5, 2018
1 parent 4a9624a commit 4ee8ec3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion admin/tool/uploadcourse/tests/course_test.php
Expand Up @@ -266,7 +266,7 @@ public function test_data_saved() {
global $DB;
$this->resetAfterTest(true);

cron_setup_user(); // To avoid warnings related to 'moodle/course:setforcedlanguage' capability check.
$this->setAdminUser(); // To avoid warnings related to 'moodle/course:setforcedlanguage' capability check.

// Create.
$mode = tool_uploadcourse_processor::MODE_CREATE_NEW;
Expand Down
2 changes: 1 addition & 1 deletion backup/moodle2/restore_stepslib.php
Expand Up @@ -1827,7 +1827,7 @@ public function process_course($data) {
// When restoring to a new course we can set all the things except for the ID number.
$canchangeidnumber = $isnewcourse || has_capability('moodle/course:changeidnumber', $context, $userid);
$canchangesummary = $isnewcourse || has_capability('moodle/course:changesummary', $context, $userid);
$canforcelanguage = has_capability('moodle/course:setforcedlanguage', $context);
$canforcelanguage = has_capability('moodle/course:setforcedlanguage', $context, $userid);

$data = (object)$data;
$data->id = $this->get_courseid();
Expand Down

0 comments on commit 4ee8ec3

Please sign in to comment.