mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +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) {
|
if (container == null && model.SourceContainerId != 0) {
|
||||||
return HttpNotFound();
|
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);
|
var query = _contentManager.Query<ContainablePart>(VersionOptions.Latest);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user