Moodle
  1. Moodle
  2. MDL-39602

get_default_stores() does not ensure stores have been included.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.3
    • Fix Version/s: 2.4.4
    • Component/s: Caching
    • Labels:
      None
    • Rank:
      50293

      Description

      Michael reported an error during upgrade of 2.4 (not 2.3 or master)...

      Fatal error: Class 'cachestore_file' not found in D:\xampp\htdocs\24_integration\cache\locallib.php on line 393
      (11:18:18) Michael d: Is anyone else experiencing that?

      It looks like get_default_stores should include the required_once the store files inside that function so it is safe to call it from anywhere.

      Will get more specifics on how to trigger this error for the testing instructions.

        Activity

        Hide
        Michael de Raadt added a comment -

        This occurred for me on 2.4 only. I'm not sure why it was different.

        I'm setting up a fresh install to rule out a possible code corruption.

        This fix might be prudent regardless, but we should know if it is urgent after I set up a new instance.

        Show
        Michael de Raadt added a comment - This occurred for me on 2.4 only. I'm not sure why it was different. I'm setting up a fresh install to rule out a possible code corruption. This fix might be prudent regardless, but we should know if it is urgent after I set up a new instance.
        Hide
        Michael de Raadt added a comment -

        In the 24 fix, you'll need to shift the $CFG variable with the include calls.

        Show
        Michael de Raadt added a comment - In the 24 fix, you'll need to shift the $CFG variable with the include calls.
        Hide
        Damyon Wiese added a comment -

        From the code - I think it might only occur during upgrades (from before 2012120303.08 on 24 and before 2013041900.00 on master) and may be related to the configured cache stores.

        Show
        Damyon Wiese added a comment - From the code - I think it might only occur during upgrades (from before 2012120303.08 on 24 and before 2013041900.00 on master) and may be related to the configured cache stores.
        Hide
        Damyon Wiese added a comment -

        (I repushed with the CFG fix)

        Show
        Damyon Wiese added a comment - (I repushed with the CFG fix)
        Hide
        Michael de Raadt added a comment -

        I just ran the upgrade on a fresh site and no error came up. My previous 2.4 version was not as old as the version you suggest in the comment above.

        I'm happy with the change, but I'm not familiar with the code, so I wouldn't be confident in peer reviewing it while Sam is available.

        Show
        Michael de Raadt added a comment - I just ran the upgrade on a fresh site and no error came up. My previous 2.4 version was not as old as the version you suggest in the comment above. I'm happy with the change, but I'm not familiar with the code, so I wouldn't be confident in peer reviewing it while Sam is available.
        Hide
        Michael de Raadt added a comment -

        I've asked Sam to peer review this.

        Show
        Michael de Raadt added a comment - I've asked Sam to peer review this.
        Hide
        Sam Hemelryk added a comment -

        Thanks Michael + Damyon. Changes are spot on and I've integrated it now

        Show
        Sam Hemelryk added a comment - Thanks Michael + Damyon. Changes are spot on and I've integrated it now
        Hide
        Mark Nelson added a comment - - edited

        All upgrades went without a single issue, passing.

        Show
        Mark Nelson added a comment - - edited All upgrades went without a single issue, passing.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Did you think this day was not going to arrive ever?

        Your patience has been rewarded, yay, sent upstream, thanks!

        Closing...ciao

        Show
        Eloy Lafuente (stronk7) added a comment - Did you think this day was not going to arrive ever? Your patience has been rewarded, yay, sent upstream, thanks! Closing...ciao

          People

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

            Dates

            • Created:
              Updated:
              Resolved: