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

Settings block adds unnecessary <hr> tags

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.9
    • Fix Version/s: 2.9
    • Component/s: Blocks
    • Labels:

      Description

      There is a minor bug in block_settings_renderer::settings_tree, when it is counting the children it doesn't exclude hidden items.
      If you have the "My profile settings" item hidden, for example, it will still show a hr before "Site Administration", when it shouldn't.

      The fix would be to change:

      foreach ($navigation->children as &$child) {
          $child->preceedwithhr = ($count!==0);
          $count++;
      }
      

      To:

      foreach ($navigation->children as &$child) {
          $child->preceedwithhr = ($count!==0);
          if ($child->display) {
              $count++;
          }
      }
      

        Attachments

          Activity

            People

            Assignee:
            moodle.com moodle.com
            Reporter:
            skylarkelty Skylar Kelty
            Peer reviewer:
            Dave Cooper
            Integrator:
            Dan Poltawski
            Tester:
            Simey Lameze
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              11/May/15