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

Return page version in mod_wiki_get_page_contents

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Create a course with a student. The course must have at least one section.
      2. Create a collaborative wiki activity without groups. Add at least one page to that wiki.
      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, pageid and the URL of your Moodle instance.

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=mod_wiki_get_page_contents&pageid=1&wstoken=5b6154a56566a194f60f7f395f235179' --compressed

      6. Confirm that the version received is 1.
      7. Now edit the page and change its contents.
      8. Perform the request again and check that now the version is 2.
      Show
      Create a course with a student. The course must have at least one section. Create a collaborative wiki activity without groups. Add at least one page to that wiki. 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, pageid and the URL of your Moodle instance. curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=mod_wiki_get_page_contents&pageid=1&wstoken=5b6154a56566a194f60f7f395f235179' --compressed Confirm that the version received is 1. Now edit the page and change its contents. Perform the request again and check that now the version is 2.
    • Affected Branches:
      MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-56103-master

      Description

      Each wiki page has a version number. This version is returned in mod_wiki_get_page_for_editing, but not in mod_wiki_get_page_contents. Returning it in both WebServices will allow external services to perform some local checks without having to call WebService.

        Attachments

          Activity

            People

            Assignee:
            dpalou Dani Palou
            Reporter:
            dpalou Dani Palou
            Peer reviewer:
            Frédéric Massart
            Integrator:
            Dan Poltawski
            Tester:
            Simey Lameze
            Participants:
            Component watchers:
            Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón, 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