diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Controllers/AdminController.cs b/src/Orchard.Web/Modules/Orchard.Widgets/Controllers/AdminController.cs index 5af232225..7daa44705 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Controllers/AdminController.cs +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Controllers/AdminController.cs @@ -61,7 +61,7 @@ namespace Orchard.Widgets.Controllers { return RedirectToAction("Index", "Admin", new { area = "Dashboard" }); } - IEnumerable layers = _widgetsService.GetLayers().ToList(); + IEnumerable layers = _widgetsService.GetLayers().OrderBy(x => x.Name).ToList(); if (!layers.Any()) { Services.Notifier.Error(T("There are no widget layers defined. A layer will need to be added in order to add widgets to any part of the site.")); @@ -87,10 +87,10 @@ namespace Orchard.Widgets.Controllers { if (!String.IsNullOrWhiteSpace(culture)) { widgets = widgets.Where(x => { - if(x.Has()) { + if (x.Has()) { return String.Equals(x.As().Culture, culture, StringComparison.InvariantCultureIgnoreCase); } - + return false; }).ToList(); } @@ -142,7 +142,7 @@ namespace Orchard.Widgets.Controllers { return RedirectToAction("Index"); } - IEnumerable layers = _widgetsService.GetLayers().ToList(); + IEnumerable layers = _widgetsService.GetLayers().OrderBy(x => x.Name).ToList(); if (!layers.Any()) { Services.Notifier.Error(T("Layer not found: {0}", layerId)); @@ -315,7 +315,8 @@ namespace Orchard.Widgets.Controllers { try { _widgetsService.DeleteLayer(id); Services.Notifier.Information(T("Layer was successfully deleted")); - } catch (Exception exception) { + } + catch (Exception exception) { Logger.Error(T("Removing Layer failed: {0}", exception.Message).Text); Services.Notifier.Error(T("Removing Layer failed: {0}", exception.Message)); }