Moodle
  1. Moodle
  2. MDL-27295

Categories with Sub-Categories Should not Show "(0)" Courses

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.0.2, 2.1.1, 2.2
    • Fix Version/s: 2.1.2
    • Component/s: Navigation
    • Labels:
    • Testing Instructions:
      Hide

      1/ Create two categories, 'Category A' and 'Category B'
      2/ Create a course 'course 1' and add it to category A
      3/ Go to front page settings and select 'list of categories' as display when logged in
      4/ View front page and see the list of categories

      Expected result:
      ------------------------
      Two categories displayed:
      'Category A (1)'
      'Category B'

      Actual result:
      ------------------------
      'Category A' (1)'
      'Category B (0)'

      Show
      1/ Create two categories, 'Category A' and 'Category B' 2/ Create a course 'course 1' and add it to category A 3/ Go to front page settings and select 'list of categories' as display when logged in 4/ View front page and see the list of categories Expected result: ------------------------ Two categories displayed: 'Category A (1)' 'Category B' Actual result: ------------------------ 'Category A' (1)' 'Category B (0)'
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:
    • Rank:
      17030

      Description

      This is a trivial suggested improvement which I believe would make course organization a little clearer. Currently, when one builds a heirarchy of course categories and sub-categories, if a category has no courses directly listed then it will show on the list of courses a "(0)" next to the name. This way, it appears as though the highest-level categories are showing that they contain nothing. I think it would be better if a categories which contain no courses directly but rather sub-categories with courses, no number should be displayed. I have attached a picture showing the current view and this proposed change. An alternative is to have this number indicate the total number of courses contained within the category and sub-categories.

        Issue Links

          Activity

          Hide
          Dan Poltawski added a comment -

          I agree. And here is a patch which achieves that.

          What i'm unclear about is if this behaviour was changed to make it more explicit since I dont recall this being like that in 1.9

          Show
          Dan Poltawski added a comment - I agree. And here is a patch which achieves that. What i'm unclear about is if this behaviour was changed to make it more explicit since I dont recall this being like that in 1.9
          Hide
          Dan Poltawski added a comment -

          Just looked in the 1.9 code and indeed this is new for 2.x

          Show
          Dan Poltawski added a comment - Just looked in the 1.9 code and indeed this is new for 2.x
          Hide
          Andrew Davis added a comment - - edited

          Looks good to me

          Dan are you able to submit this for integration or would you like me to do it for you? Also, are you able to create branches for 2.0 stable and 2.1 stable to go with the master branch version? I can do that for you if you don't know what I'm talking about

          Show
          Andrew Davis added a comment - - edited Looks good to me Dan are you able to submit this for integration or would you like me to do it for you? Also, are you able to create branches for 2.0 stable and 2.1 stable to go with the master branch version? I can do that for you if you don't know what I'm talking about
          Hide
          Dan Poltawski added a comment -

          Thanks for the review - I can submit for integration!

          Show
          Dan Poltawski added a comment - Thanks for the review - I can submit for integration!
          Hide
          Sam Hemelryk added a comment -

          Hi Dan, anything I can help with here?
          Would be cool to get these changes in.

          Show
          Sam Hemelryk added a comment - Hi Dan, anything I can help with here? Would be cool to get these changes in.
          Hide
          Dan Poltawski added a comment -

          Integrators this patch can be cherry-picked to 21_STABLE

          Show
          Dan Poltawski added a comment - Integrators this patch can be cherry-picked to 21_STABLE
          Hide
          Dan Poltawski added a comment -

          Sorry for the delay, i've now submitted this for integration. Note that the change moved the behaviour back to 1.9 style. Note also that displaying (0) is very misleading because there could in fact be a subcategory with courses in it

          Show
          Dan Poltawski added a comment - Sorry for the delay, i've now submitted this for integration. Note that the change moved the behaviour back to 1.9 style. Note also that displaying (0) is very misleading because there could in fact be a subcategory with courses in it
          Hide
          Sam Hemelryk added a comment -

          Thanks Dan this has been integrated now and cherry-picked to 21.

          Show
          Sam Hemelryk added a comment - Thanks Dan this has been integrated now and cherry-picked to 21.
          Hide
          Rajesh Taneja added a comment -

          Front page looks Great
          Thanks for fixing this Dan.

          Show
          Rajesh Taneja added a comment - Front page looks Great Thanks for fixing this Dan.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          git repositories have been updated with your awesome changes, thanks! Closing.

          Show
          Eloy Lafuente (stronk7) added a comment - git repositories have been updated with your awesome changes, thanks! Closing.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: