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

WS get_course_contents is not handling sectioncount > numsections sections correctly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.2
    • Fix Version/s: 3.2
    • Component/s: Course, Web Services
    • Labels:
    • Testing Instructions:
      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
    • Affected Branches:
      MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-56754-master

      Description

      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)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jleyva Juan Leyva
              Reporter:
              jleyva Juan Leyva
              Peer reviewer:
              Pau Ferrer
              Integrator:
              Andrew Nicols
              Tester:
              Adrian Greeve
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón, Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                5/Dec/16