Filter unpublished items when displaying tags

--HG--
branch : dev
This commit is contained in:
Sebastien Ros
2010-07-29 11:25:26 -07:00
parent 8a215ef0a6
commit da148300e0

View File

@@ -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) {