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

core_course_check_updates is returning incorrect file updates when editing the module settings

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: 3.2
    • Component/s: Web Services
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a Page with some files in the content and in the description (like an image).
      2. As admin, enable "Mobile services": Site administration ► Mobile app
      3. Create a Token in the mobile app service for the teacher 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, courseid, the timestamp (use current timestamp) and the cmid of the page you created

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseid=X&tocheck[0][contextlevel]=module&tocheck[0][id]=100&tocheck[0][since]=1476274596
          &wsfunction=core_course_check_updates&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' | python -m "json.tool"

      5. Check that you don't receive any update.
      6. Now click to edit the page and Save without changing anything.
      7. Call the WS with the exact same parameters as before. Check that you receive updates only in configuration
      Show
      Create a Page with some files in the content and in the description (like an image). As admin, enable "Mobile services": Site administration ► Mobile app Create a Token in the mobile app service for the teacher 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, courseid, the timestamp (use current timestamp) and the cmid of the page you created curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseid=X&tocheck [0] [contextlevel] =module&tocheck [0] [id] =100&tocheck [0] [since] =1476274596 &wsfunction=core_course_check_updates&wstoken=ffbe3a3002f235bf9d01fd9369e10b66' | python -m "json.tool" Check that you don't receive any update. Now click to edit the page and Save without changing anything. Call the WS with the exact same parameters as before. Check that you receive updates only in configuration
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-57051-master

      Description

      How to reproduce:

      1. Create a Page with some files in the content and in the description.
      2. Call WS check_updates for that module with current datetime and check that no updates are returned.
      3. Now click to edit the page and Save without changing anything.
      4. Call the WS with the exact same parameters as before. Check that you receive updates in configuration, introfiles and contentfiles.

      The reason is that the WS checks for folders, so we always receive changes in the root folder because of how draft files work. We should ignore folders since we'll receive the new files inside them anyway. The only downside is that we won't receive new empty subfolders, but those won't be downloadable anyway so that shouldn't be a problem.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

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