mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 11:44:58 +08:00
Merge pull request #6044 from DanielLackenbyBede/daniellackenbybede/bug/6043/listable_content
[Fixes #6043] Filter out when no contentTypeNames provided
This commit is contained in:
@@ -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()) {
|
||||
|
@@ -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) {
|
||||
|
Reference in New Issue
Block a user