mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
#18501: Redirecting to Layers managements when trying to access Widgets with no layers configured
Work Item: 18501 --HG-- branch : 1.x
This commit is contained in:
@@ -51,10 +51,11 @@ namespace Orchard.Widgets.Controllers {
|
||||
dynamic Shape { get; set; }
|
||||
|
||||
public ActionResult Index(int? layerId) {
|
||||
IEnumerable<LayerPart> layers = _widgetsService.GetLayers();
|
||||
IEnumerable<LayerPart> layers = _widgetsService.GetLayers().ToList();
|
||||
|
||||
if (layers.Count() == 0) {
|
||||
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."));
|
||||
return RedirectToAction("AddLayer");
|
||||
}
|
||||
|
||||
LayerPart currentLayer = layerId == null
|
||||
|
Reference in New Issue
Block a user