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

Boost flat navigation may unintentionally indent nodes.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • 3.3.4, 3.4.1
    • 3.2.5, 3.3.2
    • Themes
    • Any
    • MOODLE_32_STABLE, MOODLE_33_STABLE
    • MOODLE_33_STABLE, MOODLE_34_STABLE
    • MDL-60653-master
    • Hide

      The work around is to always assign string keys to navigation nodes.

      Show
      The work around is to always assign string keys to navigation nodes.
    • Hide

      **You are going to want a plugin that you can modify. Use a glossary for example.

      1. Set the Moodle theme to Boost
      2. Create a course and enter the course.
      3. Create a glossary in the course and go to the glossary you just created
      4. Modify the implementation of the function glossary_extend_navigation to the following

      function glossary_extend_navigation($navigation, $course, $module, $cm) {
          $node = $navigation->create('This is a test for MDL-60653', 'http://test.test', \navigation_node::TYPE_CUSTOM, null, 0);
          $node->showinflatnavigation = true;
          $navigation->add_node($node);
      }
      

      # Visit the glossary you created at step 3

      1. Verify that the node shows up in the flat navigation menu of Boost.
      2. Verify that the node is not indented. It should look like after.png and not like before.png.

       

      Show
      **You are going to want a plugin that you can modify. Use a glossary for example. Set the Moodle theme to Boost Create a course and enter the course. Create a glossary in the course and go to the glossary you just created Modify the implementation of the function glossary_extend_navigation to the following function glossary_extend_navigation($navigation, $course, $module, $cm) { $node = $navigation->create( 'This is a test for MDL-60653' , 'http://test.test' , \navigation_node::TYPE_CUSTOM, null , 0 ); $node->showinflatnavigation = true ; $navigation->add_node($node); } # Visit the glossary you created at step 3 Verify  that the node shows up in the flat navigation menu of Boost. Verify that the node is not indented. It should look like after.png and not like before.png.  

    Description

      On line 437 of lib/navigationlib.php the double equal comparison is used to compare text strings instead of the triple equal.  This means if the key is an integer and equal to 0, then the node will be indented because 0 is equal to "courseindexpage".  It should be noted that the navigation library defaults to using integers, starting with 0, if no key value is assigned.

      There is a work around: Set the "key" value for the node to a string value.

      Attachments

        1. before.png
          before.png
          17 kB
        2. after.png
          after.png
          17 kB

        Activity

          People

            tbannister Tyler Bannister
            tbannister Tyler Bannister
            Shamim Rezaie Shamim Rezaie
            David Monllaó David Monllaó
            Jake Dallimore Jake Dallimore
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Clockify

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