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

Small performance win by calling filter_preload_activities($this->get_modinfo());

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Enable any filter for content + headings
      Visit a course with many activities (> 50), but no activity descriptions visible on the course page (no labels etc).
      Check the number of DB reads is low (< 50)

      Show
      Enable any filter for content + headings Visit a course with many activities (> 50), but no activity descriptions visible on the course page (no labels etc). Check the number of DB reads is low (< 50)
    • Affected Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-46147-master

      Description

      On a course with no activity descriptions but filters enabled on content and headings, the filters are not preloaded for all the activities in a course, because the call to
      filter_preload_activities($this->get_modinfo());
      exists only in get_formatted_content() - not in get_formatted_name() (in modinfolib.php)
      This results in 1 db query per activity.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                14/Jul/14