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

WS get_course_contents is not handling sectioncount > numsections sections correctly

XMLWordPrintable

    • MOODLE_31_STABLE
    • MOODLE_32_STABLE
    • MDL-56754-master
    • Hide
      1. In a course create a stealth section with one or more orphan activities (this is done configuring the course to have, for example, 10 sections, adding activities to the last section, and then reducing the number of sections for the course either by using the small minus at the bottom of the course or through the course settings page), this section is not visible by students but the activities can be accessed via a direct link or the activities block
      2. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
      3. Create a Token in the mobile app service for one user:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      4. Next, you can do a CURL REST call simulating a WS client with the user replacing the course id

        curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseid=4&wsfunction=core_course_get_contents&wstoken=12a2a65aeea2a177055e233f9e303218' --compressed

      5. Please, check that in the response the not visible section has a 1 in the hiddenbynumsections field and the normal sections have a 0
      Show
      In a course create a stealth section with one or more orphan activities (this is done configuring the course to have, for example, 10 sections, adding activities to the last section, and then reducing the number of sections for the course either by using the small minus at the bottom of the course or through the course settings page), this section is not visible by students but the activities can be accessed via a direct link or the activities block As admin, enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token in the mobile app service for one user: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the user replacing the course id curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseid=4&wsfunction=core_course_get_contents&wstoken=12a2a65aeea2a177055e233f9e303218' --compressed Please, check that in the response the not visible section has a 1 in the hiddenbynumsections field and the normal sections have a 0

      Right now is returning all the sections without advising if is a stealth section or not, this have some implications (in the mobile app right now the stealth section are displayed)

            jleyva Juan Leyva
            jleyva Juan Leyva
            Pau Ferrer Pau Ferrer
            Andrew Lyons Andrew Lyons
            Adrian Greeve Adrian Greeve
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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