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

navigation_node doesn't support TYPE_CONTAINER in get_css_type()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.4
    • 3.2.3, 3.3.1
    • Navigation
    • MOODLE_32_STABLE, MOODLE_33_STABLE
    • MOODLE_34_STABLE
    • MDL-59277-master
    • Hide
      1. Throw a window.console.log(nodes) in the render function in ajax_response_renderer.js
      2. Add the nav block to the dashboard
      3. Expand 'Courses' and then expand one of your test courses
      4. Now, in the console, check the first child of the most recent object (this is the course participants node) and observe that the class is listed as 'type_container'.
      5. Now, load up clean theme and go to the navigation block and click the 'Participants' node in a course so that you're redirected.
      6. You should see the block still present on the page, with the Participants node expanded.
      7. Now, using your browser dev tools, search the dom for 'type_container' and verify that you see that class on the participants <li> element. On an unpatched branch, this is marked as type_unknown, so feel free to compare this to stable branches to confirm this.
      8. Run the lib/tests/navigationlib_test.php unit test and confirm it passes.
      Show
      Throw a window.console.log(nodes) in the render function in ajax_response_renderer.js Add the nav block to the dashboard Expand 'Courses' and then expand one of your test courses Now, in the console, check the first child of the most recent object (this is the course participants node) and observe that the class is listed as 'type_container'. Now, load up clean theme and go to the navigation block and click the 'Participants' node in a course so that you're redirected. You should see the block still present on the page, with the Participants node expanded. Now, using your browser dev tools, search the dom for 'type_container' and verify that you see that class on the participants <li> element. On an unpatched branch, this is marked as type_unknown, so feel free to compare this to stable branches to confirm this. Run the lib/tests/navigationlib_test.php unit test and confirm it passes.

      To replicate:

      1. Throw a window.console.log(nodes) in the render function ajax_response_renderer.js
      2. Add the nav block to the dashboard
      3. Expand 'Courses' and then 'YOUR_TEST_COURSE'
      4. Now, in the console, check the first child of the most recent object (this is the course participants node) and observe that the class is listed as 'type_unknown'. This conflicts with the original designation of TYPE_CONTAINER as set in add_course_essentials().

      Possible Fix:
      Looks like the --MDL-41811-- (5ab32c11b) introduced the $namedtypes array but forgot to add support for the container type, so adding

      90 => 'container'
      

      Should be fairly trivial, and appears to solve this at surface level at least.

            jaked Jake Dallimore
            jaked Jake Dallimore
            Adrian Greeve Adrian Greeve
            Dan Poltawski Dan Poltawski
            Marina Glancy Marina Glancy
            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.