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

Coding exception thrown when viewing nested categories

XMLWordPrintable

    • MOODLE_21_STABLE
    • MOODLE_20_STABLE, MOODLE_21_STABLE
    • Easy

      In certain situations (see testing instructions for an example), Moodle breaks while building the navigation tree. A "coding exception" message is displayed to the user.

      This occurs when a category of at least 2nd level is added to the navigation tree, in global_navigation::load_all_categories() .

      The problematic piece of code is near line 1454. The code tries to add all parent categories of a give category to the navigation tree, but fails to handle the root category (id=0) correctly.

      See patch attached for details of the problem. Note that this patch also fixes MDL-28254.

      Replication instructions:

      The database needs to contain a course category, and a subcategory of it.

      • Log in as admin
      • Navigate to: Site administration -> Courses -> Add/edit courses
      • Click on the name of the subcategory.
      • "Coding exception" message is now displayed.

            samhemelryk Sam Hemelryk
            bostelm Henning Bostelmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.