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

New Web Service mod_data_get_fields

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Create a course with a database using the image gallery preset
      2. Enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      3. Create a Token in the mobile app service for a student enrolled in the course where the database is:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      4. Next, you can do a CURL REST call simulating a WS client with the student token.
        • You need to replace the wstoken, databaseid (with the database instance id) and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'databaseid=13&wsfunction=mod_data_get_fields&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool"

      5. Now check that you receive correctly the list of fields that the database is using (in this case the fields for the image gallery preset)
      6. You can compare the information returned by the WS with the records in the data_fields table in the Moodle DB for the database activity.
      Show
      Create a course with a database using the image gallery preset Enable "Mobile services": Site administration ► Mobile app ► Mobile settings Create a Token in the mobile app service for a student enrolled in the course where the database is: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the student token. You need to replace the wstoken, databaseid (with the database instance id) and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'databaseid=13&wsfunction=mod_data_get_fields&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool" Now check that you receive correctly the list of fields that the database is using (in this case the fields for the image gallery preset) You can compare the information returned by the WS with the records in the data_fields table in the Moodle DB for the database activity.
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-57919-master

      Description

      Return the list of configured fields for the given database.

      This will require each field type to return the settings available to avoid security issues (maybe there are configuration tokens exposed there)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jleyva Juan Leyva
                Reporter:
                jleyva Juan Leyva
                Peer reviewer:
                Pau Ferrer
                Integrator:
                Eloy Lafuente (stronk7)
                Tester:
                Eloy Lafuente (stronk7)
                Participants:
                Component watchers:
                Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Juan Leyva, Jake Dallimore, Jun Pataleta
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  15/May/17