Skip to content

Commit

Permalink
MDL-69809 mod_folder: include forcedownload setting in WS responses.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulholden committed Nov 10, 2020
1 parent d330035 commit 5148154
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions mod/folder/classes/external.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ public static function get_folders_by_courses_returns() {
'display' => new external_value(PARAM_INT, 'Display type of folder contents on a separate page or inline'),
'showexpanded' => new external_value(PARAM_INT, '1 = expanded, 0 = collapsed for sub-folders'),
'showdownloadfolder' => new external_value(PARAM_INT, 'Whether to show the download folder button'),
'forcedownload' => new external_value(PARAM_INT, 'Whether file download is forced'),
'section' => new external_value(PARAM_INT, 'Course section id'),
'visible' => new external_value(PARAM_INT, 'Module visibility'),
'groupmode' => new external_value(PARAM_INT, 'Group mode'),
Expand Down
4 changes: 3 additions & 1 deletion mod/folder/tests/externallib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,13 @@ public function test_mod_folder_get_folders_by_courses() {
// First folder.
$record = new stdClass();
$record->course = $course1->id;
$record->forcedownload = 1;
$folder1 = self::getDataGenerator()->create_module('folder', $record);

// Second folder.
$record = new stdClass();
$record->course = $course2->id;
$record->forcedownload = 0;
$folder2 = self::getDataGenerator()->create_module('folder', $record);

// Execute real Moodle enrolment as we'll call unenrol() method on the instance later.
Expand All @@ -154,7 +156,7 @@ public function test_mod_folder_get_folders_by_courses() {
// Create what we expect to be returned when querying the two courses.
$expectedfields = array('id', 'coursemodule', 'course', 'name', 'intro', 'introformat', 'introfiles', 'revision',
'timemodified', 'display', 'showexpanded', 'showdownloadfolder', 'section', 'visible',
'groupmode', 'groupingid');
'forcedownload', 'groupmode', 'groupingid');

// Add expected coursemodule and data.
$folder1->coursemodule = $folder1->cmid;
Expand Down

0 comments on commit 5148154

Please sign in to comment.