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

mod_data_get_fields WS fails when a database without fields is used

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Create a course with a database without adding fields.
      2. Enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      3. Create a Token in the mobile app service for a user 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 in the curl response the fields attribute is an empty array
      Show
      Create a course with a database without adding fields. Enable "Mobile services": Site administration ► Mobile app ► Mobile settings Create a Token in the mobile app service for a user 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 in the curl response the fields attribute is an empty array
    • Affected Branches:
      MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-59619-master

      Description

      This happens if we are testing a database without fields.

        Attachments

          Activity

            People

            Assignee:
            jleyva Juan Leyva
            Reporter:
            jleyva Juan Leyva
            Peer reviewer:
            Dani Palou
            Integrator:
            Dan Poltawski
            Tester:
            Ankit Agarwal
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              11/Sep/17