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

Turning off Server Files Repository breaks courses that used it

XMLWordPrintable

    • MOODLE_23_STABLE, MOODLE_31_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE
    • MOODLE_33_STABLE, MOODLE_34_STABLE
    • wip-MDL-37757-master
    • Hide

      Upgrade to 2.4.

      Show
      Upgrade to 2.4.
    • Hide
      1. Create a file system repository (See this document for details about how to do that - https://docs.moodle.org/34/en/File_system_repository)
      2. Upload some testing files (images, pdf, video). Create a folder, file, or label (picture in the editor) resource .
      3. Add these files to a course. Add them both as a copy and as an alias.
      4. Add a file via the server files repository. You will have to find a file that you have used before that is an alias, you can tell by the blue arror in the bottom left corner. Choose a file that is from the file system repository originally.
      5. Remove the repository (without copying over the files). Go to "Site administration > Plugins > Repositories" And change the Active status to Disabled.
      6. Enter the course and visit all the locations that you used the repository to insert files.
      7. The files that were an alias should now be removed and there should be no error about an invalid repository id.
      8. Follow the above process with the Server files repository, and Private files (in step 4 use the file system repository instead of the server files repository). Check that there is no error about an invalid repository id.
      Show
      Create a file system repository (See this document for details about how to do that - https://docs.moodle.org/34/en/File_system_repository ) Upload some testing files (images, pdf, video). Create a folder, file, or label (picture in the editor) resource . Add these files to a course. Add them both as a copy and as an alias. Add a file via the server files repository. You will have to find a file that you have used before that is an alias, you can tell by the blue arror in the bottom left corner. Choose a file that is from the file system repository originally. Remove the repository (without copying over the files). Go to "Site administration > Plugins > Repositories" And change the Active status to Disabled. Enter the course and visit all the locations that you used the repository to insert files. The files that were an alias should now be removed and there should be no error about an invalid repository id. Follow the above process with the Server files repository, and Private files (in step 4 use the file system repository instead of the server files repository). Check that there is no error about an invalid repository id.

      I turned off the Server Files Repository and as a result a course that used it broke completely. Any attempt to access the course returned the following error:

      http://docs.moodle.org/23/en/error/repository/invalidrepositoryid

      Apparently the only place in the Moodle codebase that throws this error is line 538 of repository/lib.php

      I fixed the error by turning the Server Files Repository back on, then manually editing the entries in the table mdl_files_reference so that their repositoryid column, which pointed to the now non-existant repository id "1", pointed instead to the repository id "9" which the newly enabled Server Files repository had been issued with.

      I would have expected the files to simply not appear.

            abgreeve Adrian Greeve
            bawjaws David Scotson
            Mihail Geshoski Mihail Geshoski
            Andrew Lyons Andrew Lyons
            Gladys Basiana Gladys Basiana
            Votes:
            8 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.