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

Course renderer tries to use $course->subcategories and $course->courses when they may not be defined yet

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.4, 2.2.1
    • Fix Version/s: 2.1.5, 2.2.2
    • Component/s: Course
    • Labels:
    • Testing Instructions:
      Hide

      Setup

      • Navigate to Settings -> Site administration -> Front page -> Front page settings
        • Set 'frontpage' and 'frontpageloggedin' to show the 'Combo list'
        • Set 'maxcategorydepth' to 1
      • Navigate to Settings -> Site administration -> Courses -> Add/edit courses
        • Create a new course category at the top level 'top category'
        • Create a new course category in 'top category' called 'middle category'
        • Create a new course category in 'middle category' called 'bottom category'
        • Create a new course in 'middle category' called 'middle course'
      • Navigate to the front page
        • Confirm that the category listing is displayed as defined:
      • top category
        • middle category
          • middle course
          • bottom category
      Show
      Setup Navigate to Settings -> Site administration -> Front page -> Front page settings Set 'frontpage' and 'frontpageloggedin' to show the 'Combo list' Set 'maxcategorydepth' to 1 Navigate to Settings -> Site administration -> Courses -> Add/edit courses Create a new course category at the top level 'top category' Create a new course category in 'top category' called 'middle category' Create a new course category in 'middle category' called 'bottom category' Create a new course in 'middle category' called 'middle course' Navigate to the front page Confirm that the category listing is displayed as defined: top category middle category middle course bottom category
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-31502-master-2

      Description

      The Combo List frontpage item throws errors about undefined stdClass objects (courses and categories) when the maxcategorydepth is set to a lower number than the total depth

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            dobedobedoh Andrew Nicols added a comment -

            This patch on master cherry-picks cleanly to MOODLE_22_STABLE

            Show
            dobedobedoh Andrew Nicols added a comment - This patch on master cherry-picks cleanly to MOODLE_22_STABLE
            Hide
            dobedobedoh Andrew Nicols added a comment -

            This patch also applies cleanly to MOODLE_21_STABLE

            Show
            dobedobedoh Andrew Nicols added a comment - This patch also applies cleanly to MOODLE_21_STABLE
            Hide
            salvetore Michael de Raadt added a comment -

            Thanks for sharing that.

            Sorry for the delay in getting these peer reviewed. We really appreciate the work you are contributing.

            Show
            salvetore Michael de Raadt added a comment - Thanks for sharing that. Sorry for the delay in getting these peer reviewed. We really appreciate the work you are contributing.
            Hide
            rajeshtaneja Rajesh Taneja added a comment -

            Thanks for fixing this Andrew
            Patch is spot-on, please feel free to push it for integration review.

            Show
            rajeshtaneja Rajesh Taneja added a comment - Thanks for fixing this Andrew Patch is spot-on, please feel free to push it for integration review.
            Hide
            rajeshtaneja Rajesh Taneja added a comment -

            @integrator: Please cherry-pick it on 22 and 21.
            Thanks.

            Show
            rajeshtaneja Rajesh Taneja added a comment - @integrator: Please cherry-pick it on 22 and 21. Thanks.
            Hide
            dobedobedoh Andrew Nicols added a comment -

            Apologies, but I've just updated the commit message here as I noticed that I'd put the wrong bug number in. I've made no changes to the patch so it shouldn't require peer reviewing again.

            Show
            dobedobedoh Andrew Nicols added a comment - Apologies, but I've just updated the commit message here as I noticed that I'd put the wrong bug number in. I've made no changes to the patch so it shouldn't require peer reviewing again.
            Hide
            samhemelryk Sam Hemelryk added a comment -

            Thanks Andrew, this has been integrated now

            Show
            samhemelryk Sam Hemelryk added a comment - Thanks Andrew, this has been integrated now
            Hide
            andyjdavis Andrew Davis added a comment -

            Works as described. Passing.

            Show
            andyjdavis Andrew Davis added a comment - Works as described. Passing.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            It is late here and I'm very tired but I didn't want to go to sleep before expressing my admiration for your amazing collaboration. Thanks!

            Closing as fixed, heading to zzzZZZzzz, niao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - It is late here and I'm very tired but I didn't want to go to sleep before expressing my admiration for your amazing collaboration. Thanks! Closing as fixed, heading to zzzZZZzzz, niao

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/Mar/12