• Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.6
    • 2.5
    • Web Services
    • MOODLE_25_STABLE
    • MOODLE_26_STABLE
    • wip-MDL-40038-master
    • Hide

      Setup

      1. Create an activity such as an assignment or database.
      2. Setup webservices for the api core_files_get_files()
        http://docs.moodle.org/25/en/Using_web_services
      3. In the above setup make sure the user you are going to use for making ws calls is admin or as all the permissions required to upload files to private area.
      4. Get your fav client from https://github.com/moodlehq/sample-ws-clients or use the one I use https://github.com/ankitagarwal/moodle-ws-client/blob/master/client.php (I have included files for this in the attachements section).

      Test - 1

      • Run unit tests and make sure they all pass. (files/tests/externallib_test.php)

      Test - 2

      Using the web services client with a context id.

      1. The easiest way to get all the information that you need is to open the database and look at the mdl_files records. This has the contextid, filearea, itemid, filepath, filename etc.
      1. Fill in the parameters in your webservices client. If you leave $filename blank, you will get more information.

      Make sure you can see information about the file.

      Test - 3

      Without context id

      1. Now fill in the parameters setting $contextid = -1 and filling in $contextlevel and $instanceid.
        • Contextlevel is probably something like 'module' depending on where you are looking for the file.
        • The instance id is the id for the module or something similar.

      Make sure that you get the same information back as when you used the context id.

      Show
      Setup Create an activity such as an assignment or database. Setup webservices for the api core_files_get_files() http://docs.moodle.org/25/en/Using_web_services In the above setup make sure the user you are going to use for making ws calls is admin or as all the permissions required to upload files to private area. Get your fav client from https://github.com/moodlehq/sample-ws-clients or use the one I use https://github.com/ankitagarwal/moodle-ws-client/blob/master/client.php (I have included files for this in the attachements section). Test - 1 Run unit tests and make sure they all pass. (files/tests/externallib_test.php) Test - 2 Using the web services client with a context id. The easiest way to get all the information that you need is to open the database and look at the mdl_files records. This has the contextid, filearea, itemid, filepath, filename etc. Fill in the parameters in your webservices client. If you leave $filename blank, you will get more information. Make sure you can see information about the file. Test - 3 Without context id Now fill in the parameters setting $contextid = -1 and filling in $contextlevel and $instanceid. Contextlevel is probably something like 'module' depending on where you are looking for the file. The instance id is the id for the module or something similar. Make sure that you get the same information back as when you used the context id.
    • BACKEND Sprint 3

      Remove contextid from core_files_external::get_files, context should not be exposed externally

        1. ws_client.php
          2 kB
          Adrian Greeve
        2. ws_curl.php
          18 kB
          Adrian Greeve

            abgreeve Adrian Greeve
            ankit_frenz Ankit Agarwal
            Frédéric Massart Frédéric Massart
            Damyon Wiese Damyon Wiese
            Ankit Agarwal Ankit Agarwal
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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