diff --git a/src/Orchard.Web/Modules/Orchard.Projections/Controllers/AdminController.cs b/src/Orchard.Web/Modules/Orchard.Projections/Controllers/AdminController.cs index 2086f845d..eb9dfc794 100644 --- a/src/Orchard.Web/Modules/Orchard.Projections/Controllers/AdminController.cs +++ b/src/Orchard.Web/Modules/Orchard.Projections/Controllers/AdminController.cs @@ -168,6 +168,11 @@ namespace Orchard.Projections.Controllers { viewModel.FilterGroups = filterGroupEntries; + if (viewModel.FilterGroups.Any(group => group.Filters.Count() == 0)) { + _services.Notifier.Warning( + T("This Query has at least one empty filter group, which will cause all content items to be returned, unless the Projection using this Query limits the number of content items displayed.")); + } + #endregion #region Load Sort criterias diff --git a/src/Orchard.Web/Modules/Orchard.Projections/Drivers/ProjectionPartDriver.cs b/src/Orchard.Web/Modules/Orchard.Projections/Drivers/ProjectionPartDriver.cs index 255386709..7230ac7c3 100644 --- a/src/Orchard.Web/Modules/Orchard.Projections/Drivers/ProjectionPartDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Projections/Drivers/ProjectionPartDriver.cs @@ -355,6 +355,12 @@ namespace Orchard.Projections.Drivers { updater.AddModelError("PagerSuffix", T("Suffix should not contain special characters.")); } + if (model.Items == 0 + && (part.Record.QueryPartRecord?.FilterGroups.Any(group => group.Filters.Count == 0) ?? false)) { + _orchardServices.Notifier.Warning( + T("The selected Query has at least one empty filter group, which causes all content items to be returned. It is recommended to limit the number of content items queried by setting the 'Items to display' field to a non-zero value.")); + } + return Editor(part, shapeHelper); }