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

External functions are returning deleted messages and miss the new time*deleted fields

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.0.3
    • 3.0.1
    • Messages
    • MOODLE_30_STABLE
    • MOODLE_30_STABLE
    • MDL-52570-master
    • Hide
      1. Create two user accounts (normal authenticated users) user1 and user2
      2. Using the message option, interchange some messages between the two users
      3. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
      4. Create a Token for the the both users:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      5. Next, you can do a CURL REST call simulating a WS client with the user1.
        • You need to replace the wstoken with the user1 token, the useridfrom (user1), useridto (user2) and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' -data 'useridto=2&useridfrom=1&limitfrom=0&limitnum=49&read=1&type=conversations&newestfirst=1&moodlewssettingfilter=true&wsfunction=core_message_get_messages&wstoken=ffbe3a3002f235bf9d01fd93;2D;2D69e10b66' --compressed | python -m "json.tool"

      6. Check that you receive all the messages you sent to the user2
      7. Now, using the web interface, log in as the user1 and delete a couple of the messages sent to the user2
      8. Call the WS again, confirm that you don't see the deleted messages
      9. Run the same WS call but using the user2 token
      10. Confirm that you still see all the messages
      11. Now, log in as user2, an delete one of the messages sent by the user1 (please, delete a message that was also deleted by the user1 in the previous step)
      12. Run the WS again and check that you don't see that message
      Show
      Create two user accounts (normal authenticated users) user1 and user2 Using the message option, interchange some messages between the two users As admin, enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for the the both users: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the user1. You need to replace the wstoken with the user1 token, the useridfrom (user1), useridto (user2) and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' -data 'useridto=2&useridfrom=1&limitfrom=0&limitnum=49&read=1&type=conversations&newestfirst=1&moodlewssettingfilter=true&wsfunction=core_message_get_messages&wstoken=ffbe3a3002f235bf9d01fd93;2D;2D69e10b66' --compressed | python -m "json.tool" Check that you receive all the messages you sent to the user2 Now, using the web interface, log in as the user1 and delete a couple of the messages sent to the user2 Call the WS again, confirm that you don't see the deleted messages Run the same WS call but using the user2 token Confirm that you still see all the messages Now, log in as user2, an delete one of the messages sent by the user1 (please, delete a message that was also deleted by the user1 in the previous step) Run the WS again and check that you don't see that message

      When MDL-29801 was implemented, the external functions (and some API functions like message_get_messages) weren't updated so the Mobile app is returning deleted messages and we don't have a way to filter them.

            jleyva Juan Leyva
            jleyva Juan Leyva
            David Monllaó David Monllaó
            Andrew Lyons Andrew Lyons
            Ryan Wyllie Ryan Wyllie
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

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