{"action":"closed","issue":{"url":"https://api.github.com/repos/OrchardCMS/OrchardTest/issues/3053","labels_url":"https://api.github.com/repos/OrchardCMS/OrchardTest/issues/3053/labels{/name}","comments_url":"https://api.github.com/repos/OrchardCMS/OrchardTest/issues/3053/comments","events_url":"https://api.github.com/repos/OrchardCMS/OrchardTest/issues/3053/events","html_url":"https://github.com/OrchardCMS/OrchardTest/issues/3053","id":67827443,"number":3053,"title":"Menu Widget Levels to display it is broken","user":{"login":"orchardbot","id":11788683,"avatar_url":"https://avatars.githubusercontent.com/u/11788683?v=3","gravatar_id":"","url":"https://api.github.com/users/orchardbot","html_url":"https://github.com/orchardbot","followers_url":"https://api.github.com/users/orchardbot/followers","following_url":"https://api.github.com/users/orchardbot/following{/other_user}","gists_url":"https://api.github.com/users/orchardbot/gists{/gist_id}","starred_url":"https://api.github.com/users/orchardbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orchardbot/subscriptions","organizations_url":"https://api.github.com/users/orchardbot/orgs","repos_url":"https://api.github.com/users/orchardbot/repos","events_url":"https://api.github.com/users/orchardbot/events{/privacy}","received_events_url":"https://api.github.com/users/orchardbot/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OrchardCMS/OrchardTest/labels/medium","name":"medium","color":"ededed"},{"url":"https://api.github.com/repos/OrchardCMS/OrchardTest/labels/resolved","name":"resolved","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/OrchardCMS/OrchardTest/milestones/17","html_url":"https://github.com/OrchardCMS/OrchardTest/milestones/Orchard%201.7.2","labels_url":"https://api.github.com/repos/OrchardCMS/OrchardTest/milestones/17/labels","id":1062862,"number":17,"title":"Orchard 1.7.2","description":"Please read our release notes for Orchard 1.7.2:\n[url:http://docs.orchardproject.net/Documentation/Orchard-1-7-2-Release-Notes]\n\n*Please* do not post questions as reviews. Questions should be posted in the Discussions tab, where they will usually get promptly responded to. If you post a question as a review, you will pollute the rating, and you won't get an answer.","creator":{"login":"orchardbot","id":11788683,"avatar_url":"https://avatars.githubusercontent.com/u/11788683?v=3","gravatar_id":"","url":"https://api.github.com/users/orchardbot","html_url":"https://github.com/orchardbot","followers_url":"https://api.github.com/users/orchardbot/followers","following_url":"https://api.github.com/users/orchardbot/following{/other_user}","gists_url":"https://api.github.com/users/orchardbot/gists{/gist_id}","starred_url":"https://api.github.com/users/orchardbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orchardbot/subscriptions","organizations_url":"https://api.github.com/users/orchardbot/orgs","repos_url":"https://api.github.com/users/orchardbot/repos","events_url":"https://api.github.com/users/orchardbot/events{/privacy}","received_events_url":"https://api.github.com/users/orchardbot/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":2,"state":"closed","created_at":"2015-04-11T05:02:14Z","updated_at":"2015-04-11T19:53:18Z","due_on":"2013-11-19T08:00:00Z","closed_at":"2015-04-11T05:02:14Z"},"comments":3,"created_at":"2012-11-06T13:29:12Z","updated_at":"2015-04-11T19:53:18Z","closed_at":"2015-04-11T19:53:18Z","body":"__FILIP07__ created:\r\nhttps://orchard.codeplex.com/workitem/19226\r\n\r\nI expect that \"Levels to display\" setting must limit the displayed menu levels. Instead, it show only that level. If my assumption is correct, the fix could be this code (MenuWidgetPartDriver.cs):\n                    //// apply display level ?\n                    //if(part.Levels > 0) {\n                    //    var current = topLevelItems.ToList();\n                    //    for (int j=1; j < part.Levels; j++ ) {\n                    //        var temp = new List<MenuItem>();\n                    //        foreach (var menuItem in current) {\n                    //            temp.AddRange(menuItem.Items);\n                    //        }\n                    //        current = temp;\n                    //    }\n\n                    //    topLevelItems = current;\n\n                    //    // cut the sub-levels of any selected menu item\n                    //    foreach (var menuItem in topLevelItems) {\n                    //        menuItem.Items = Enumerable.Empty<MenuItem>();\n                    //    }                \n\n                    //}\n\n                    // apply display level ?\n                    if (part.Levels > 0)\n                    {\n                        var current = topLevelItems.ToList();\n                        for (int j = 1; j < part.Levels; j++)\n                        {\n                            var temp = new List<MenuItem>();\n                            foreach (var menuItem in current)\n                            {\n                                temp.AddRange(menuItem.Items);\n                            }\n                            current = temp;\n                        }\n\n                        // cut the sub-levels of any selected menu item\n                        foreach (var menuItem in current)\n                        {\n                            menuItem.Items = Enumerable.Empty<MenuItem>();\n                        }\n\n                    }\n\n"}}