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

Make MAX_COURSES_IN_CATEGORY configurable

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Check sort order:

      1. Install a new site.
      2. Check the current number of categories:
        `select count(id) from mdl_course_categories;`
        • We call it "NUM_OF_CAT".  If it is a fresh install, the  NUM_OF_CAT will be "1" (only Miscellaneous category)
        • We will use "NUM_OF_CAT" to calculate sort order values for categories and courses)
      3. Set $CFG->maxcoursesincategory = 20000 in config.php
      4. Create 2 categories: Category A and Category B
      5. Check the sort order of these two categories:
        `select name, sortorder from mdl_course_categories;`
      6. Verify:
        • The sortorder for Category A equals 40000
        • The sortorder for Category B equals 60000
      7. Create 2 courses in Category A: Course 1 and Course 2
      8. Check the sort order of these two courses:
        `select fullname, sortorder from mdl_course;`
      9. Verify
        • The sortorder of course 1 is equal to 40002 (Sort Order Of Category A + 2)
        • The sortorder of Course 2 is 40001 (Sort Order Of Category A + 1)

       

      Show
      Check sort order: Install a new site. Check the current number of categories: ` select count(id) from mdl_course_categories; ` We call it "NUM_OF_CAT".  If it is a fresh install, the  NUM_OF_CAT will be "1" (only Miscellaneous category) We will use "NUM_OF_CAT" to calculate sort order values for categories and courses) Set $CFG->maxcoursesincategory = 20000 in config.php Create 2 categories: Category A and Category B Check the sort order of these two categories: ` select name, sortorder from mdl_course_categories; ` Verify: The sortorder for Category A equals 40000 The sortorder for Category B equals 60000 Create 2 courses in Category A: Course 1 and Course 2 Check the sort order of these two courses: ` select fullname, sortorder from mdl_course; ` Verify The sortorder of course 1 is equal to 40002 (Sort Order Of Category A + 2) The sortorder of Course 2 is 40001 (Sort Order Of Category A + 1)  
    • Affected Branches:
      MOODLE_400_STABLE
    • Fixed Branches:
      MOODLE_310_STABLE
    • Pull 3.10 Branch:
      MDL-69573-MOODLE_310_STABLE
    • Pull Master Branch:
      MDL-69573-Master

      Description

      In our moodle site, there are a category with more than 10 000 courses. It will be great if we can set MAX_COURSES_IN_CATEGORY in an admin setting instead of modifying lib/datalib.php file

       

      Regards

      {{

      {debugging("The number of courses (category id: $str) has reached MAX_COURSES_IN_CATEGORY (" . MAX_COURSES_IN_CATEGORY . "), it will cause a sorting performance issue, please increase the value of MAX_COURSES_IN_CATEGORY in lib/datalib.php file. See tracker issue: MDL-25669", DEBUG_DEVELOPER);}

      }

        Attachments

        1. MDL-69573.jpg
          15 kB
          Anna Carissa Sadia

          Activity

            People

            Assignee:
            Nguyen Nathan Nguyen
            Reporter:
            Nguyen Nathan Nguyen
            Peer reviewer:
            Dmitrii Metelkin
            Integrator:
            Jake Dallimore
            Tester:
            Anna Carissa Sadia
            Participants:
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              9/Nov/20

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours, 30 minutes
                4h 30m