From d1819a7f773cf22094b08fadf5c559b8defd687e Mon Sep 17 00:00:00 2001 From: Dave Reed Date: Wed, 23 Mar 2011 11:56:14 -0700 Subject: [PATCH] Choose items defaults to filter content type by the restricted type of the target container. --HG-- branch : dev --- .../Modules/Orchard.Lists/Controllers/AdminController.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Orchard.Web/Modules/Orchard.Lists/Controllers/AdminController.cs b/src/Orchard.Web/Modules/Orchard.Lists/Controllers/AdminController.cs index 8f7ffdf82..08f9a1f70 100644 --- a/src/Orchard.Web/Modules/Orchard.Lists/Controllers/AdminController.cs +++ b/src/Orchard.Web/Modules/Orchard.Lists/Controllers/AdminController.cs @@ -199,6 +199,12 @@ namespace Lists.Controllers { if (container == null && model.SourceContainerId != 0) { return HttpNotFound(); } + if (string.IsNullOrEmpty(model.FilterByContentType)) { + var targetContainer = _contentManager.Get(model.TargetContainerId); + if (targetContainer != null) { + model.FilterByContentType = targetContainer.Record.ItemContentType; + } + } var query = _contentManager.Query(VersionOptions.Latest);