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

Custom menu breaks when nested deeper than 2 levels

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0.1
    • Component/s: General, Navigation
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      Custom menu breaks when nested deeper than 2 levels.

      Test menu structure to show the issue

      FIRST

      • menu1.1
        SECOND
      • menu2.1
      • menu2.2
        • menu2.2.1
          • menu2.2.1.1
            THIRD
      • menu3.1

      In line 2346 in the function "convert_text_to_menu_nodes($text)" "$depth = $lastdepth - 1;" depth step back is hard coded to 1 step. That does not work when nesting is more than 2 steps and you need to go back to root.

        Gliffy Diagrams

          Activity

          Hide
          samhemelryk Sam Hemelryk added a comment -

          Thanks for spotting that Urs, I've just attached a patch that fixes that bug by properly recursing the tree rather than assuming movement of one.

          Petr or Martin could you please review this patch for me?

          Cheers
          Sam

          Show
          samhemelryk Sam Hemelryk added a comment - Thanks for spotting that Urs, I've just attached a patch that fixes that bug by properly recursing the tree rather than assuming movement of one. Petr or Martin could you please review this patch for me? Cheers Sam
          Hide
          skodak Petr Skoda added a comment -

          +1

          Show
          skodak Petr Skoda added a comment - +1
          Hide
          samhemelryk Sam Hemelryk added a comment -

          Thanks for the review Petr, I've commit the patch now.
          Thanks for spotting the bug and reporting it Urs, it will now be fixed in 2.0.1.

          Cheers
          Sam

          Show
          samhemelryk Sam Hemelryk added a comment - Thanks for the review Petr, I've commit the patch now. Thanks for spotting the bug and reporting it Urs, it will now be fixed in 2.0.1. Cheers Sam

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                25/Dec/10