Merge pull request #6044 from DanielLackenbyBede/daniellackenbybede/bug/6043/listable_content

[Fixes #6043] Filter out when no contentTypeNames provided
This commit is contained in:
Sébastien Ros
2015-11-19 12:25:05 -08:00
2 changed files with 2 additions and 1 deletions

View File

@@ -22,6 +22,7 @@ namespace Orchard.Core.Contents {
var contentTypeDefinitions = _contentDefinitionManager.ListTypeDefinitions().OrderBy(d => d.Name);
builder.AddImageSet("content")
.Add(T("Content"), "1.4", menu => menu
.Permission(Permissions.EditOwnContent)
.Add(T("Content Items"), "1", item => item.Action("List", "Admin", new { area = "Contents", id = "" }).LocalNav()));
var contentTypes = contentTypeDefinitions.Where(ctd => ctd.Settings.GetModel<ContentTypeSettings>().Creatable).OrderBy(ctd => ctd.DisplayName);
if (contentTypes.Any()) {

View File

@@ -92,7 +92,7 @@ namespace Orchard.ContentManagement {
}
private void ForType(params string[] contentTypeNames) {
if (contentTypeNames != null && contentTypeNames.Length != 0) {
if (contentTypeNames != null) {
var contentTypeIds = contentTypeNames.Select(GetContentTypeRecordId).ToArray();
// don't use the IN operator if not needed for performance reasons
if (contentTypeNames.Length == 1) {