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

Custom menu multi-language support breaks menu nesting

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.11, 2.5.8, 2.6.5, 2.7.1, 2.7.2, 2.8
    • Fix Version/s: 2.8
    • Component/s: Navigation, Themes
    • Labels:
    • Testing Instructions:
      Hide

      Under admin/settings.php, populate "Custom menu items" with the following:

      English|/my|English|en
      -Child of English|/my|Child of English
      Spanish|/my|Spanish|es
      -Child of Spanish|/my|Child of Spanish

      Install Spanish language

      View the homepage in English and in Spanish, make sure that the custom menu tree is rendered properly (i.e. "Child of xxx" is not displayed if the "xxx" is not displayed)

      Show
      Under admin/settings.php, populate "Custom menu items" with the following: English|/my|English|en -Child of English|/my|Child of English Spanish|/my|Spanish|es -Child of Spanish|/my|Child of Spanish Install Spanish language View the homepage in English and in Spanish, make sure that the custom menu tree is rendered properly (i.e. "Child of xxx" is not displayed if the "xxx" is not displayed)
    • Affected Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_28_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-46652-master

      Description

      If a parent menu item contains a language code that is not the language of the current user, then its child menu items will be displayed under a different parent.

      REPRODUCE

      Under admin/settings.php, populate "Custom menu items" with the following:

      English|/my|English|en
      -Child of English|/my|Child of English
      Spanish|/my|Spanish|es
      -Child of Spanish|/my|Child of Spanish

      EXPECTED RESULT

      Rendered menu structure:

      English|/my|English|en
      -Child of English|/my|Child of English

      OR

      English|/my|English|en
      -Child of English|/my|Child of English
      Spanish|/my|Spanish|es
      -Child of Spanish|/my|Child of Spanish

      ACTUAL RESULT

      Rendered menu structure:

      English|/my|English|en
      -Child of English|/my|Child of English
      -Child of Spanish|/my|Child of Spanish

      CODE

      In lib\outputcomponents.php -> convert_text_to_menu_nodes(), menu items for a different language are simply removed from the config text interpreter, thus altering the final structure of the menu.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              pjking07 PJ King
              Reporter:
              pjking07 PJ King
              Peer reviewer:
              Jetha Chan
              Integrator:
              Sam Hemelryk
              Tester:
              Zachary Durber
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan, Bas Brands
              Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                10/Nov/14