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

Empty Categories in My Courses are always shown.

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Minor
    • 2.4.5, 2.5.1
    • 2.4, 2.5
    • Navigation
    • MOODLE_24_STABLE, MOODLE_25_STABLE
    • MOODLE_24_STABLE, MOODLE_25_STABLE
    • Hide

      Create these categories and courses:

      • cat1, with course c1
      • cat2, with course c2
      • cat3, without courses and with subcategories:
        • cat31, with course c31
        • cat32, with course c32
        • cat33, with courses c331 and c332

      Enrol a user (as student) in all the "odd" courses (those which name ends with "1", aka c1, c31 and c331). Log in as that user.

      In the navigation block, my courses:

      • With $CFG->navshowmycoursecategories disabled you get the raw list of courses in the block (c1, c31 and c331).
      • With $CFG->navshowmycoursecategories enabled, expand the whole tree, you get the categories tree and only the enrolled courses (c1, c31 and c331).
      • Both the category cat2 and and cat32 aren't shown in the tree as far as the user does not have enrolled courses there (before the patch c32 was shown in the tree).

      Optionally, if MDL-40392 is already integrated, run the behat tests specified there, they should pass (2 scenarios).

      Show
      Create these categories and courses: cat1, with course c1 cat2, with course c2 cat3, without courses and with subcategories: cat31, with course c31 cat32, with course c32 cat33, with courses c331 and c332 Enrol a user (as student) in all the "odd" courses (those which name ends with "1", aka c1, c31 and c331). Log in as that user. In the navigation block, my courses: With $CFG->navshowmycoursecategories disabled you get the raw list of courses in the block (c1, c31 and c331). With $CFG->navshowmycoursecategories enabled, expand the whole tree, you get the categories tree and only the enrolled courses (c1, c31 and c331). Both the category cat2 and and cat32 aren't shown in the tree as far as the user does not have enrolled courses there (before the patch c32 was shown in the tree). Optionally, if MDL-40392 is already integrated, run the behat tests specified there, they should pass (2 scenarios).

    Description

      This issue is closely related to MDL-38631 and assumes the changes from MDL-38631 were integrated.

      All categories in My Courses are shown, even if a user does not have any courses in them.

      Steps to reproduce:

      1. Create multiple categories with courses
      2. Enlist a user into a course in of single category
      3. In My Courses every available category is shown, but when you click on a category where you don't have any courses it is simply empty.

      In my oppinion, showing empty categories serves no purpose at all. I've implemented a sample fix for this issue, it can be found in repo git://129.187.81.134/moodle/moodle.git in branch MDL-38631-hide_empty . This fix is used by us (TU München) since March and we did not find any issues with it.

      Attachments

        Issue Links

          Activity

            People

              stronk7 Eloy Lafuente (stronk7)
              alendit Dimitri Vorona
              Sam Hemelryk Sam Hemelryk
              Dan Poltawski Dan Poltawski
              Ankit Agarwal Ankit Agarwal
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                8/Jul/13