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

Incorrect implementation of load_many_for_cache() in multiple places

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.11.7, 4.0.1
    • None
    • Caching
    • None

    Description

      There are a number of places in core that implement load_many_for_cache() incorrectly:

      \core_message\time_last_message_between_users
      \mod_assign\cache\overrides
      \mod_lesson\cache\overrides
      \mod_quiz\cache\overrides

      Specifically, they all use the same code:

              foreach ($keys as $key) {
                  $results[] = $this->load_for_cache($key);
              }
      

      The problem is that $results needs to be indexed by key. I would also note the the documentation around it so not clear, which likely leads to the issue.

      Attachments

        Activity

          People

            emerrill Eric Merrill
            emerrill Eric Merrill
            Matteo Scaramuccia, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: