Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-11938 make_categories_list is expensive in the case of large category trees
  3. MDL-27691

Call to print_category_edit() in course/index.php causes many SQL-Queries and should use get_child_categories()

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.9.12
    • Fix Version/s: 1.9
    • Component/s: Performance
    • Labels:
      None
    • Testing Instructions:
      Hide

      Just call course/index.php

      Show
      Just call course/index.php
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      I found, that in the file course/index.php we have the function "print_category_edit()", which prints the categories recursively, when you do Site Administration->Courses->Add/Edit courses.

      Shouldn't we change the Line:

      if ($categories = get_categories($category->id)) { // Print all the children recursively

      to

      if ($categories = get_child_categories($category->id)) { // Print all the children recursively

      ?

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            wagner139 Andreas Wagner
            Participants:
            Component watchers:
            Matteo Scaramuccia, Andrew Nicols, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              3/Mar/08