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

course_overview block doesn't retrieve all required fields for get_fast_modinfo

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.3, 2.4
    • Fix Version/s: 2.3.2
    • Component/s: Blocks, Course
    • Labels:
    • Testing Instructions:
      Hide

      Preparation:

      • to be enrolled on a couple of courses
      • for those courses to have some activities including some of the following
        • chat
        • assign (2.3 version)
        • forum
        • lesson
        • quiz
        • scorm

      Testing

      I'd advise looking at the db read/write count both before and after applying this patch

      • Open /my
      • look at the db read/write count
      • ensure that all expected overview items are seen both before and after applying
      Show
      Preparation: to be enrolled on a couple of courses for those courses to have some activities including some of the following chat assign (2.3 version) forum lesson quiz scorm Testing I'd advise looking at the db read/write count both before and after applying this patch Open /my look at the db read/write count ensure that all expected overview items are seen both before and after applying
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-34783-master-1

      Description

      We've been seeing some massive speed issues on the /my page and they largely seem to be a result of get_fast_modinfo repeatedly resetting.
      Having tracked this issue back:

      • blocks/course_overview/block_course_overview.php::get_content()
        • calls enrol_get_my_courses() to retrieve a list of courses
        • passes this list to print_overview($courses, $remote_courses)
      • course/lib.php::print_overview()
        • loops through each module, and calls its {$mod->name})print_overview() function
      • {$mod->name})print_overview() calls get_all_instances_in_courses()
      • lib/datalib.php::get_all_instances_in_courses() calls get_fast_modinfo()
      • lib/modinfolib.php::get_fast_modinfo()
        • checks whether the cache is filled and a relevant entry is found for the specified course
        • if found returns
        • if not inserts a new course_modinfo object into the cache
      • lib/modinfolib.php::course_modinfo
        • checks whether the supplied course has a valid modinfo and sectioncache - if not, it calls rebuild_course_cache which resets the get_fast_modinfo cache

      Unfortunately though, the course_overview block doesn't retrieve the sectioncache field for each course from the DB, and as a result, every time a course is retrieved, the entire get_fast_modinfo cache is emptied.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    10/Sep/12