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

    • MOODLE_33_STABLE
    • MOODLE_33_STABLE
    • MDL-59619-master
    • 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

    Description

      This happens if we are testing a database without fields.

      Attachments

        Activity

          People

            jleyva Juan Leyva
            jleyva Juan Leyva
            Dani Palou Dani Palou
            Dan Poltawski Dan Poltawski
            Ankit Agarwal Ankit Agarwal
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Clockify

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