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

course/lib.php's get_module_metadata() function never uses its cache

    XMLWordPrintable

    Details

      Description

      This is not a functionality bug, but potentially a performance issue. In course/lib.php's get_module_metadata() function a static variable is initialized to cache module information and the information is stored in it, but cache never gets used because the check to see if module information has been stored is incorrect.

      The check current looks like this:

      if (isset($modlist[$modname])) {
          // This module is already cached
          $return[$modname] = $modlist[$course->id][$modname];
          continue;
      }

      It should look like this:

      if (isset($modlist[$course->id][$modname])) {
          // This module is already cached
          $return[$modname] = $modlist[$course->id][$modname];
          continue;
      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              samhemelryk Sam Hemelryk
              Reporter:
              sbc24 Sam Chaffee
              Integrator:
              Dan Poltawski
              Tester:
              Dan Poltawski
              Participants:
              Component watchers:
              Matteo Scaramuccia, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                14/Jan/13