Moodle
  1. Moodle
  2. MDL-43511

question bank should not store references to MUC cache

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5.4, 2.6
    • Fix Version/s: 2.5.5, 2.6.2, 2.7
    • Component/s: Questions
    • Labels:
    • Story Points (Obsolete):
      2
    • Sprint:
      BACKEND Sprint 8

      Description

      MUC cache instances are cached internally, developers are expected to not store references to the cache returned from cache::make() because it breaks some types of MUC resets and probably when using different $identifiers parameter.

      I discovered this the hard way when hacking MUC in phpunit, the questions tests started breaking badly because of the $this->cache = cache::make('core', 'questiondata'); in question/engine/bank.php

      I was bitten by similar problem previously in dml drivers too...

        Gliffy Diagrams

          Activity

          Hide
          Petr Skoda added a comment -

          Adding a few candidates for peer-review...

          Show
          Petr Skoda added a comment - Adding a few candidates for peer-review...
          Hide
          Tim Hunt added a comment -

          +1 thanks Petr.

          Show
          Tim Hunt added a comment - +1 thanks Petr.
          Hide
          Damyon Wiese added a comment -

          Thanks Petr,

          Looks safe and makes sense.

          Integrated to 25 (cherry-pick), 26 and master.

          About the cherry-pick - the code is identical and this sort of thing can be very hard to debug so if this is worth fixing, it is worth fixing on all branches.

          Show
          Damyon Wiese added a comment - Thanks Petr, Looks safe and makes sense. Integrated to 25 (cherry-pick), 26 and master. About the cherry-pick - the code is identical and this sort of thing can be very hard to debug so if this is worth fixing, it is worth fixing on all branches.
          Hide
          Andrew Davis added a comment -

          Appears to be working as it should. Passing.

          Show
          Andrew Davis added a comment - Appears to be working as it should. Passing.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Well done is better than well said.

          Closing, big thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Well done is better than well said. Closing, big thanks!

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Agile