Moodle
  1. Moodle
  2. MDL-30891

Couldn't disable legacy course files repository

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.1.5, 2.2.2
    • Labels:
    • Environment:
      Gentoo GNU/Linux, PHP version 5.3.8, MySQL version 5.0.70 I could provide more information if requested.
    • Database:
      MySQL
    • Testing Instructions:
      Hide

      1. Activate "Legacy course files" under repository plugins
      2. Try to disable it
      3. The following error page says: "Coding error detected, it must be fixed by a programmer: PHP catchable fatal error".

      Show
      1. Activate "Legacy course files" under repository plugins 2. Try to disable it 3. The following error page says: "Coding error detected, it must be fixed by a programmer: PHP catchable fatal error".
    • Workaround:
      Hide

      Because disabling it was impossible, I configure the "Legacy course files" repository to "enabled but hidden".

      Show
      Because disabling it was impossible, I configure the "Legacy course files" repository to "enabled but hidden".
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w03_MDL-30891_m23_repository
    • Rank:
      33900

      Description

      I needed to transfer very large backup files from a running 1.9 version to a recently installed 2.2.
      The upload of those backup was impossible due to the configured PHP post size restriction.
      Because both Moodle installation shared the same server, I thought that maybe there is some repository in 2.2 that could be configured to access the same files as the other Moodle 1.9 instance.
      I saw the "Legacy course files" repository and activated it.
      I was looking for some kind of path configuration but this repository has no settings.
      It wasn't what I'm looking for, so I decided to disable it.
      After a warning page that says:
      "Are you sure you want to remove this repository plugin, its options and all of its instances - Legacy course files?"
      I hit continue and saw the following error:
      "Coding error detected, it must be fixed by a programmer: PHP catchable fatal error"

      Previous 2.x series versions could also be affected. I only tried this in a recent 2.2 version.

        Activity

        Hide
        Michael de Raadt added a comment -

        Thanks for reporting this.

        I was able to reproduce the problem.

        The error report was:

        Debug info: Argument 2 passed to has_capability() must be an instance of context, null given, called in D:\xampp\htdocs\moodle_testing\repository\lib.php on line 872 and defined
        Stack trace:
        
            line 365 of \lib\setuplib.php: coding_exception thrown
            line 348 of \lib\accesslib.php: call to default_error_handler()
            line 872 of \repository\lib.php: call to has_capability()
            line 434 of \repository\lib.php: call to repository::get_instances()
            line 188 of \admin\repository.php: call to repository_type->delete()
        
        Show
        Michael de Raadt added a comment - Thanks for reporting this. I was able to reproduce the problem. The error report was: Debug info: Argument 2 passed to has_capability() must be an instance of context, null given, called in D:\xampp\htdocs\moodle_testing\repository\lib.php on line 872 and defined Stack trace: line 365 of \lib\setuplib.php: coding_exception thrown line 348 of \lib\accesslib.php: call to default_error_handler() line 872 of \repository\lib.php: call to has_capability() line 434 of \repository\lib.php: call to repository::get_instances() line 188 of \admin\repository.php: call to repository_type->delete()
        Hide
        Petr Škoda added a comment -

        Thanks for the report. I really can not say that I like the admin UI for repos both inside and outside, this particular problem was caused by plugin name hardcoding which I consider particularly not nice.

        Ciao

        Show
        Petr Škoda added a comment - Thanks for the report. I really can not say that I like the admin UI for repos both inside and outside, this particular problem was caused by plugin name hardcoding which I consider particularly not nice. Ciao
        Hide
        Sam Hemelryk added a comment -

        Thanks dude, this is integrated.

        Show
        Sam Hemelryk added a comment - Thanks dude, this is integrated.
        Hide
        Michael de Raadt added a comment -

        Test result: success

        Tested disable/enable of "Legacy course files" under 21, 22 and master.

        Show
        Michael de Raadt added a comment - Test result: success Tested disable/enable of "Legacy course files" under 21, 22 and master.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        This is now available in the git and cvs repositories.

        Consider the responsibility of your fingerprints engraved there for future generations!

        Thanks for the work, closing, ciao

        Show
        Eloy Lafuente (stronk7) added a comment - This is now available in the git and cvs repositories. Consider the responsibility of your fingerprints engraved there for future generations! Thanks for the work, closing, ciao

          People

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

            Dates

            • Created:
              Updated:
              Resolved: