From cdaea02714c6b336a559ac1e671530ff7a8108c6 Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Thu, 22 Sep 2011 16:19:39 -0700 Subject: [PATCH] #18135: Publishing changes to the body of an item wipes out tags Work Item: 18135 --HG-- branch : 1.x --- .../Modules/Orchard.Tags/Services/TagService.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Tags/Services/TagService.cs b/src/Orchard.Web/Modules/Orchard.Tags/Services/TagService.cs index 426c14b91..31ad4b681 100644 --- a/src/Orchard.Web/Modules/Orchard.Tags/Services/TagService.cs +++ b/src/Orchard.Web/Modules/Orchard.Tags/Services/TagService.cs @@ -177,15 +177,14 @@ namespace Orchard.Tags.Services { var tags = tagNamesForContentItem.Select(CreateTag); var newTagsForContentItem = new List(tags); - var currentTagsForContentItem = _contentTagRepository.Fetch(x => x.TagsPartRecord.Id == contentItem.Id); + var currentTagsForContentItem = contentItem.As().Record.Tags; foreach (var tagContentItem in currentTagsForContentItem) { if (!newTagsForContentItem.Contains(tagContentItem.TagRecord)) { _contentTagRepository.Delete(tagContentItem); } - else { - newTagsForContentItem.Remove(tagContentItem.TagRecord); - } + + newTagsForContentItem.Remove(tagContentItem.TagRecord); } foreach (var newTagForContentItem in newTagsForContentItem) {