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 Bug
    • Status: Closed
    • Priority: Minor 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
    • Rank:
      38041

      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

        Activity

        Hide
        Andrew Nicols added a comment -

        This patch on master cherry-picks cleanly to MOODLE_22_STABLE

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

        This patch also applies cleanly to MOODLE_21_STABLE

        Show
        Andrew Nicols added a comment - This patch also applies cleanly to MOODLE_21_STABLE
        Hide
        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
        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
        Rajesh Taneja added a comment -

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

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

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

        Show
        Rajesh Taneja added a comment - @integrator: Please cherry-pick it on 22 and 21. Thanks.
        Hide
        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
        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
        Sam Hemelryk added a comment -

        Thanks Andrew, this has been integrated now

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

        Works as described. Passing.

        Show
        Andrew Davis added a comment - Works as described. Passing.
        Hide
        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
        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: