mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 19:04:51 +08:00
Filter unpublished items when displaying tags
--HG-- branch : dev
This commit is contained in:
@@ -102,12 +102,10 @@ namespace Orchard.Tags.Services {
|
||||
}
|
||||
|
||||
public IEnumerable<IContent> GetTaggedContentItems(int id) {
|
||||
List<IContent> contentItems = new List<IContent>();
|
||||
IEnumerable<TagsContentItems> tagsContentItems = _tagsContentItemsRepository.Fetch(x => x.TagId == id);
|
||||
foreach (var tagContentItem in tagsContentItems) {
|
||||
contentItems.Add(_contentManager.Get(tagContentItem.ContentItemId));
|
||||
}
|
||||
return contentItems;
|
||||
return _tagsContentItemsRepository
|
||||
.Fetch(x => x.TagId == id)
|
||||
.Select(t =>_contentManager.Get(t.ContentItemId))
|
||||
.Where(c => c!= null);
|
||||
}
|
||||
|
||||
public void TagContentItem(int contentItemId, string tagName) {
|
||||
|
Reference in New Issue
Block a user