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

navigation_node doesn't support TYPE_CONTAINER in get_css_type()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2.3, 3.3.1
    • Fix Version/s: 3.4
    • Component/s: Navigation
    • Labels:
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-59277-master

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/Nov/17