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

Wrong parameters number for external_value in forums WS

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7.7, 2.8.5, 2.9.4, 3.0.2
    • Fix Version/s: 2.9.5, 3.0.3
    • Component/s: Forum, Web Services
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a course and at least 1 forum in it.
      2. Create a student and a teacher and enrol them in the course.
      3. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
      4. Create a Token for the student user.
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      5. Next, you can do a CURL REST call simulating a WS client with the student user.
        • You need to replace the wstoken, courseid and the URL of your moodle instance.

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=mod_forum_get_forums_by_courses&wstoken=5b6154a56566a194f60f7f395f235179&courseids%5B0%5D=2' --compressed

      6. Confirm that you receive a list with the forums.
      Show
      Create a course and at least 1 forum in it. Create a student and a teacher and enrol them in the course. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for the student user. Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the student user. You need to replace the wstoken, courseid and the URL of your moodle instance. curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=mod_forum_get_forums_by_courses&wstoken=5b6154a56566a194f60f7f395f235179&courseids%5B0%5D=2' --compressed Confirm that you receive a list with the forums.
    • Affected Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE, MOODLE_30_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-49612-master

      Description

      In some forum WebServices the external_value class is instantiated with 6 parameters, but this class expects a max of 5. There's an empty string that should not be there.

      These are the cases I found:

      get_forums_by_courses_parameters
      get_forum_discussions_parameters

      External value class:
      external_value

        Attachments

          Activity

            People

            Assignee:
            dpalou Dani Palou
            Reporter:
            dpalou Dani Palou
            Peer reviewer:
            Andrew Nicols
            Integrator:
            Dan Poltawski
            Tester:
            Simey Lameze
            Participants:
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              14/Mar/16