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

External function get_forum_discussion_paginated return discussions only for the first group

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.0
    • 2.9.2
    • Forum
    • MOODLE_29_STABLE
    • MOODLE_30_STABLE
    • MDL-51637-master
    • Hide
      1. Create a course with separate groups forced
      2. Create two different users (u1 and u2) and two groups (g1 and g2)
      3. Enrol u1 in g1 and g2
      4. Enrol u2 in g1
      5. Crete a editing teacher, ensure the capability access all groups is On for the editing teacher
      6. Create a general use forum
      7. As u1, create a new discussion in the forum for g1 and another one for g2
      8. As u2, create a new discussion for your only group (g1)
      9. Create a Token for the both users:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      10. Next, you can do a CURL REST call simulating a WS client .
        • You need to replace the wstoken, forumid (the forum instance id) and the URL of your moodle instance. First use the token for u1

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

      11. Confirm that
        • You see all the messages you posted in both groups, you see the u2 discussion too
      12. Execute the same command but using the token for u2
      13. Confirm that
        • You see all the messages you posted in your group (g1) including the one posted by u1
      Show
      Create a course with separate groups forced Create two different users (u1 and u2) and two groups (g1 and g2) Enrol u1 in g1 and g2 Enrol u2 in g1 Crete a editing teacher, ensure the capability access all groups is On for the editing teacher Create a general use forum As u1, create a new discussion in the forum for g1 and another one for g2 As u2, create a new discussion for your only group (g1) Create a Token for the both users: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client . You need to replace the wstoken, forumid (the forum instance id) and the URL of your moodle instance. First use the token for u1 curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'forumid=13&sortby=timemodified&sortdirection=DESC&page=0&perpage=20&wsfunction=mod_forum_get_forum_discussions_paginated&wstoken=ffbe3a3002f235bf9d01fd9369e10b66&moodlewssettingfilter=true'| python -m "json.tool" Confirm that You see all the messages you posted in both groups, you see the u2 discussion too Execute the same command but using the token for u2 Confirm that You see all the messages you posted in your group (g1) including the one posted by u1

      If the user has access to different groups and has posted, he will only receive discussions for the first group.

      Note, this patch changes a core API function adding a new optional parameter. Changes are documented in update.txt.

            jleyva Juan Leyva
            jleyva Juan Leyva
            Dani Palou Dani Palou
            David Monllaó David Monllaó
            Frédéric Massart Frédéric Massart
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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