mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-11-28 17:32:44 +08:00
Choose items defaults to filter content type by the restricted type of the target container.
--HG-- branch : dev
This commit is contained in:
@@ -199,6 +199,12 @@ namespace Lists.Controllers {
|
||||
if (container == null && model.SourceContainerId != 0) {
|
||||
return HttpNotFound();
|
||||
}
|
||||
if (string.IsNullOrEmpty(model.FilterByContentType)) {
|
||||
var targetContainer = _contentManager.Get<ContainerPart>(model.TargetContainerId);
|
||||
if (targetContainer != null) {
|
||||
model.FilterByContentType = targetContainer.Record.ItemContentType;
|
||||
}
|
||||
}
|
||||
|
||||
var query = _contentManager.Query<ContainablePart>(VersionOptions.Latest);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user