mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-08-20 07:23:59 +08:00
Adding notification when saving a Query or a ProjectionPart to warn about the effect of an empty filter group
This commit is contained in:
parent
427f164b97
commit
f4c22e69e5
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user