Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-69809

Add forcedownload to get_folders_by_courses WS

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Manual WS test

      1. Log in as admin
      2. Enable and set up to use web services (https://docs.moodle.org/310/en/Using_web_services)
      3. Create a new course and make a note of it's ID
      4. Add a new folder activity named "Folder One"
        1. Set Force download of files to on (checked)
      5. Add a new folder activity named "Folder Two"
        1. Set Force download of files to off (unchecked)
      6. Execute the following WS method:

        $ curl -s '<WWWROOT>/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=mod_folder_get_folders_by_courses&courseids[]=<COURSEID>&wstoken=<TOKEN>' | python -m json.tool
        

      7. Confirm that the returned data contains both created folders
      8. "Folder one" should include "forcedownload": 1,
      9. "Folder two" should include "forcedownload": 0,

      Unit test

      1. Run the following testcase, confirm it passes:

        $ vendor/bin/phpunit mod/folder/tests/externallib_test.php
        

      Show
      Manual WS test Log in as admin Enable and set up to use web services ( https://docs.moodle.org/310/en/Using_web_services ) Create a new course and make a note of it's ID Add a new folder activity named "Folder One" Set Force download of files to on (checked) Add a new folder activity named "Folder Two" Set Force download of files to off (unchecked) Execute the following WS method: $ curl -s '<WWWROOT>/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=mod_folder_get_folders_by_courses&courseids[]=<COURSEID>&wstoken=<TOKEN>' | python -m json.tool Confirm that the returned data contains both created folders "Folder one" should include "forcedownload": 1, "Folder two" should include "forcedownload": 0, Unit test Run the following testcase, confirm it passes: $ vendor/bin/phpunit mod/folder/tests/externallib_test.php
    • Affected Branches:
      MOODLE_311_STABLE, MOODLE_400_STABLE
    • Fixed Branches:
      MOODLE_310_STABLE
    • Pull 3.10 Branch:
      MDL-69809-310
    • Pull Master Branch:

      Description

      In MDL-28501, a new setting was added to mod_folder, to force download or display files.

      This new setting (forcedownload), should be added to the get_folders_by_courses WS method.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              pholden Paul Holden
              Reporter:
              sarjona Sara Arjona (@sarjona)
              Peer reviewer:
              Mihail Geshoski
              Integrator:
              Andrew Nicols
              Tester:
              Janelle Barcega
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                18/Jan/21

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 45 minutes
                  1h 45m