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

Add forcedownload to get_folders_by_courses WS

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.10.1
    • 3.11, 4.0
    • Resource
    • MOODLE_311_STABLE, MOODLE_400_STABLE
    • MOODLE_310_STABLE
    • 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

      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.

            pholden Paul Holden
            sarjona Sara Arjona (@sarjona)
            Mihail Geshoski Mihail Geshoski
            Andrew Lyons Andrew Lyons
            Janelle Barcega Janelle Barcega
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

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

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.