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

Reduce data usage to easily renew lock lock wiki page-section edition

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Create a course with a student. The course must have at least one section.
      2. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
      3. Create a Token for the student user.
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      4. Take note of the student token (to be used in following instructions).
      5. Create one wiki and add a page with the following HTML code (take note of the generated pageid):

        <h1>Title1</h1>Text inside section
        <h1>Title2</h1>Text inside section
        

      6. 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_for_editing&pageid=1&wstoken=cd2be328e7db5fefa407274d1e1073a7' --compressed

      7. Confirm that you receive the same content provided to create that page.
      8. Confirm that the contentformat and version (number of edits, usually 1) is the same you provided.
      9. Now perform the request again but specifying the lockonly parameter.
        • 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_for_editing&pageid=1&lockonly=1&wstoken=cd2be328e7db5fefa407274d1e1073a7' --compressed

      10. Confirm that you receive ONLY the current version number and not the content nor contentformat.
      Show
      Create a course with a student. The course must have at least one section. 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 Take note of the student token (to be used in following instructions). Create one wiki and add a page with the following HTML code (take note of the generated pageid): <h1>Title1</h1>Text inside section <h1>Title2</h1>Text inside section 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_for_editing&pageid=1&wstoken=cd2be328e7db5fefa407274d1e1073a7' --compressed Confirm that you receive the same content provided to create that page. Confirm that the contentformat and version (number of edits, usually 1) is the same you provided. Now perform the request again but specifying the lockonly parameter. 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_for_editing&pageid=1&lockonly=1&wstoken=cd2be328e7db5fefa407274d1e1073a7' --compressed Confirm that you receive ONLY the current version number and not the content nor contentformat.
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE
    • Pull Master Branch:
      MDL-55130-master

      Description

      There isn't any WS to keep lock of a page edition on wiki without receiving all the page information. The locking only lasts 30 seconds so a new method to renew the lock is needed without wasting data usage.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              pferre22 Pau Ferrer
              Reporter:
              pferre22 Pau Ferrer
              Peer reviewer:
              Marina Glancy
              Integrator:
              Dan Poltawski
              Tester:
              Jake Dallimore
              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