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

$usecache inverted in get_all_versions_hash

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Not a bug
    • Affects Version/s: 2.7.7, 2.8, 2.9
    • Fix Version/s: None
    • Component/s: General
    • Labels:

      Description

      As reported by plushwork on IRC, get_all_versions_hash() sets a boolean for $usecache which determine whether to use MUC when fetching the list of plugins in a plugintype, however it seems to be reversed:

              $usecache = false;
              if (CACHE_DISABLE_ALL or (defined('IGNORE_COMPONENT_CACHE') and IGNORE_COMPONENT_CACHE)) {
                  $usecache = true;
              }
      // ...
                  if ($usecache) {
                      $plugs = core_component::get_plugin_list($type);
                  } else {
                      $plugs = self::fetch_plugins($type, $typedir);
                  }
      

      From my reading of this, we do not use the cache unless:

      1. CACHE_DISABLE_ALL is defined; or
      2. IGNORE_COMPONENT_CACHE is defined and truthful.

      Obviously those values suggest the opposite of the action.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dobedobedoh Andrew Lyons
              Reporter:
              dobedobedoh Andrew Lyons
              Peer reviewer:
              Dave Cooper Dave Cooper
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: