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

External function forum_get_discussions_paginated fails for users without the viewqandawithoutposting capability

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Create a course with a enrolled teacher and student
      2. Create a "Q&A" forum
      3. As teacher, post there a message
      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, forumid (the forum instance id) and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data --data 'forumid=13&sortby=timemodified&sortdirection=DESC&page=0&perpage=20&wsfunction=mod_forum_get_forum_discussions_paginated&wstoken=ffbe3a3002f235bf9d01fd9369e10b66&moodlewssettingfilter=true'

          Note: you can append | python -m "json.tool" to see the command output formatted

      6. Confirm that
        • You can see the original post details
      Show
      Create a course with a enrolled teacher and student Create a "Q&A" forum As teacher, post there a message 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, forumid (the forum instance id) and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data --data 'forumid=13&sortby=timemodified&sortdirection=DESC&page=0&perpage=20&wsfunction=mod_forum_get_forum_discussions_paginated&wstoken=ffbe3a3002f235bf9d01fd9369e10b66&moodlewssettingfilter=true' Note: you can append | python -m "json.tool" to see the command output formatted Confirm that You can see the original post details
    • Affected Branches:
      MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE
    • Fixed Branches:
      MOODLE_28_STABLE, MOODLE_29_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-50489-master

      Description

      The function returns errors:

      {exception: "invalid_response_exception", errorcode: "invalidresponse", message: "Invalid response value detected"}

      debuginfo: "discussions => Invalid response value detected: Error in response - Missing following required key in a single structure: userfullname"
      errorcode: "invalidresponse"
      exception: "invalid_response_exception"
      message: "Invalid response value detected

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jleyva Juan Leyva
                Reporter:
                jleyva Juan Leyva
                Peer reviewer:
                Dan Poltawski
                Integrator:
                Eloy Lafuente (stronk7)
                Tester:
                Eloy Lafuente (stronk7)
                Participants:
                Component watchers:
                Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Juan Leyva, Jake Dallimore, Jun Pataleta
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/Sep/15