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

Return editor files in Web Services

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.1
    • Fix Version/s: 3.2
    • Component/s: Web Services
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a new forum, add a new discussion with some posts including inline videos or images (not attachments, I'm talking about images and videos embedded in the rich text editor)
      2. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
      3. Create a Token for one user:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      4. Next, you can do a CURL REST call simulating a WS client with the user.
        • You need to replace the wstoken, discussionid (with your forum discussions id) and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'discussionid=22&moodlewssettingfilter=true&moodlewssettingfileurl=true&wsfunction=mod_forum_get_forum_discussion_posts&wstoken=ffbe3a3002f235bf9d01fd9369e10b66'

      5. Now you must check that all the images and videos inline are returned in a field called messageinlinefiles, including the name of the file, time when was modified, size, url and path
      6. Append to one of those images urls the token (?token=XYZ) and check that you can see the image
      Show
      Create a new forum, add a new discussion with some posts including inline videos or images (not attachments, I'm talking about images and videos embedded in the rich text editor) As admin, enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for one user: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the user. You need to replace the wstoken, discussionid (with your forum discussions id) and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'discussionid=22&moodlewssettingfilter=true&moodlewssettingfileurl=true&wsfunction=mod_forum_get_forum_discussion_posts&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' Now you must check that all the images and videos inline are returned in a field called messageinlinefiles , including the name of the file, time when was modified, size, url and path Append to one of those images urls the token (?token=XYZ) and check that you can see the image
    • Affected Branches:
      MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-55728-master

      Description

      The Mobile app has a functionality to download a Moodle activity to do it offline, before downloading the activity we calculate the download size to notify the user.

      Right now, we are not capable of determining the exact size because we are missing the size of the files (images or videos) in the rich text editor (like a forum post or glossary entry).

      We should use the new external_files helper functions available in 3.2 to return the complete files information (like we can do in the atto editor using the Manage files button)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jleyva Juan Leyva
              Reporter:
              jleyva Juan Leyva
              Peer reviewer:
              Dani Palou
              Integrator:
              Dan Poltawski
              Tester:
              Jun Pataleta
              Participants:
              Component watchers:
              Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                5/Dec/16