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

Files snapshots in the system account's drive not stored in unique folders

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 3.3.1, 3.4
    • Fix Version/s: 3.3.3
    • Component/s: Repositories
    • Labels:
    • Testing Instructions:
      Hide

      Testing difficulty: hard & annoying

      Prerequisites:

      • Public site running on HTTPS (may ngrok be with you)
      • Two Google Docs accounts representing two users and one Google Docs account representing the system account (please see the document Moodle testing accounts if you do not want to set up those yourself).
      • Two OneDrive accounts representing two users and one OneDrive acount representing the system account (again please see the docs).
      • Two users with the same firstname and lastname

      Setup:

      • Set up the Google OAuth2 service and Microsoft OAuth2 service
      • Connect a system account with them
      • Set up the Google Drive repository and OneDrive repository. In both case., make sure to enable the "External" type in the "Supported files" option so that files from there can be linked in Moodle.
      • Create two files with the same name and different content in each user's Google and OneDrive drive.

      Expected behaviour:

      • When the files are put to Moodle (e.g. as private files or attachments or embedded media) as links, snapshot copies of them are automatically created in the system account's drive.
      • Such copies are saved in folders that respect the hierarchy of contexts in Moodle. Each folder is named so that it uniquely identifies the context.
      • Two students with the same name can have their own external file (again with the same name) linked from their personal files.
      Show
      Testing difficulty: hard & annoying Prerequisites: Public site running on HTTPS (may ngrok be with you) Two Google Docs accounts representing two users and one Google Docs account representing the system account (please see the document Moodle testing accounts if you do not want to set up those yourself). Two OneDrive accounts representing two users and one OneDrive acount representing the system account (again please see the docs). Two users with the same firstname and lastname Setup: Set up the Google OAuth2 service and Microsoft OAuth2 service Connect a system account with them Set up the Google Drive repository and OneDrive repository. In both case., make sure to enable the "External" type in the "Supported files" option so that files from there can be linked in Moodle. Create two files with the same name and different content in each user's Google and OneDrive drive. Expected behaviour: When the files are put to Moodle (e.g. as private files or attachments or embedded media) as links, snapshot copies of them are automatically created in the system account's drive. Such copies are saved in folders that respect the hierarchy of contexts in Moodle. Each folder is named so that it uniquely identifies the context. Two students with the same name can have their own external file (again with the same name) linked from their personal files.
    • Affected Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-59505-master-gdrive
    • Sprint:
      3.4 Sprint 5

      Description

      This issue was originally reported as " Users with same name can't create file with same filename in google drive repository with system account connected". Using the google drive repository with a connected system account, when two users having the same full name upload two (distinct) files with the same name, an error 500 is triggered.

      This is the stack trace:

      line 121 of /lib/classes/oauth2/rest.php: core\oauth2\rest_exception thrown
      line 762 of /repository/googledocs/lib.php: call to core\oauth2\rest->call()
      line 982 of /repository/googledocs/lib.php: call to repository_googledocs->copy_file()
      line 964 of /lib/filelib.php: call to repository_googledocs->reference_file_selected()
      line 321 of /lib/filelib.php: call to file_save_draft_area_files()
      line 78 of /user/files.php: call to file_postupdate_standard_filemanager()

      David Mu was not able to reproduce this exact error. But it was agreed with Damyon that files snapshots stored in the system account's external drive should be stored in a folder structure that allows to easily identify the origin of the files even for students and courses with the same name.

        Attachments

        1. screenshot-0.png
          screenshot-0.png
          24 kB
        2. screenshot-1.png
          screenshot-1.png
          25 kB
        3. screenshot-2.png
          screenshot-2.png
          17 kB
        4. screenshot-3.png
          screenshot-3.png
          12 kB
        5. screenshot-4.png
          screenshot-4.png
          18 kB

          Activity

            People

            Assignee:
            mudrd8mz David Mudrák (@mudrd8mz)
            Reporter:
            scyrma Mathieu Petit-Clair
            Peer reviewer:
            Marina Glancy
            Integrator:
            Eloy Lafuente (stronk7)
            Tester:
            cameron1729
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            1 Vote for this issue
            Watchers:
            10 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              13/Nov/17