mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 03:25:23 +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) {
|
public IEnumerable<IContent> GetTaggedContentItems(int id) {
|
||||||
List<IContent> contentItems = new List<IContent>();
|
return _tagsContentItemsRepository
|
||||||
IEnumerable<TagsContentItems> tagsContentItems = _tagsContentItemsRepository.Fetch(x => x.TagId == id);
|
.Fetch(x => x.TagId == id)
|
||||||
foreach (var tagContentItem in tagsContentItems) {
|
.Select(t =>_contentManager.Get(t.ContentItemId))
|
||||||
contentItems.Add(_contentManager.Get(tagContentItem.ContentItemId));
|
.Where(c => c!= null);
|
||||||
}
|
|
||||||
return contentItems;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void TagContentItem(int contentItemId, string tagName) {
|
public void TagContentItem(int contentItemId, string tagName) {
|
||||||
|
Reference in New Issue
Block a user