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

Nextcloud repository does not support the "offline" file option leading to unexpected results for clients, like the app

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 3.5.3
    • Fix Version/s: 3.6
    • Component/s: Repositories
    • Labels:
    • Testing Instructions:
      Hide
      Prerequisite
      1. Moodle mobile app.
      2. Your Moodle mobile app should be able to connect to your Moodle website. You can either do the following:
        • Ensure that the phone with the mobile app and the web server are on the same network. Or
        • Expose the web server over the internet via ngrok.
      Testing
      1. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      2. Enable a Nextcloud repository instance (following instructions here: https://docs.moodle.org/36/en/Nextcloud_repository) or steps B and C from MDL-58943 (you can use https://demo.nextcloud.com/ )
      3. Create or use an existing course, enrolling one user as student
      4. As admin or teacher create a File resource, selecting a file from the Nextcloud instance in the file picker, using the "Create an access controlled link to the file" option when choosing the file.
      5. Now, with the mobile app, as student log in to the site, access the course and the file and try to download it
      6. You should get an error "Error while loading the content" (Getting the error it is what is expected)
      Show
      Prerequisite Moodle mobile app. Your Moodle mobile app should be able to connect to your Moodle website. You can either do the following: Ensure that the phone with the mobile app and the web server are on the same network. Or Expose the web server over the internet via ngrok. Testing As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings Enable a Nextcloud repository instance (following instructions here: https://docs.moodle.org/36/en/Nextcloud_repository ) or steps B and C from MDL-58943 (you can use https://demo.nextcloud.com/ ) Create or use an existing course, enrolling one user as student As admin or teacher create a File resource, selecting a file from the Nextcloud instance in the file picker, using the "Create an access controlled link to the file" option when choosing the file. Now, with the mobile app, as student log in to the site, access the course and the file and try to download it You should get an error "Error while loading the content" (Getting the error it is what is expected)
    • Affected Branches:
      MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-64228-master

      Description

      The repository supports controlled links but it does not support or handle the offline parameter used by the Mobile app when requesting a copy of the file to be downloaded as part of a course in the app.

      Right now, instead returning a copy of the file, what is being returned is the HTML content of the form used to perform the OAuth authentication to be able to retrieve a file from Nextcloud:

      <div style="margin-top: 250px"><div class="mdl-align"><form method="post" action="https://prototype.moodle.net/nextcloud/index.php"><div><input type="submit" value="Log in to your Nextcloud account" id="single_button5bfe533cc39d31" /><input type="hidden" name="client_id" value="lIyrNOFfijhPSuzjoew9Lm6OokZfqByxBnmc43r7QtxYm1VOoalY52M5HrHmXyy7" /><input type="hidden" name="response_type" value="code" /><input type="hidden" name="redirect_uri" value="https://mobilemaster.moodledemo.net/admin/oauth2callback.php" /><input type="hidden" name="state" value="/repository/repository_callback.php?callback=yes&repo_id=10&sesskey=oAbbvq4KKP&reloadparent=true" /><input type="hidden" name="scope" value="openid profile email files ocs" /><input type="hidden" name="sesskey" value="oAbbvq4KKP" /></div></form></div></div>

        Attachments

        1. screenshot-1.png
          screenshot-1.png
          143 kB
        2. screenshot-2.png
          screenshot-2.png
          170 kB
        3. screenshot-3.png
          screenshot-3.png
          453 kB

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  3/Dec/18