mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
#18135: Publishing changes to the body of an item wipes out tags
Work Item: 18135 --HG-- branch : 1.x
This commit is contained in:
@@ -177,15 +177,14 @@ namespace Orchard.Tags.Services {
|
||||
|
||||
var tags = tagNamesForContentItem.Select(CreateTag);
|
||||
var newTagsForContentItem = new List<TagRecord>(tags);
|
||||
var currentTagsForContentItem = _contentTagRepository.Fetch(x => x.TagsPartRecord.Id == contentItem.Id);
|
||||
var currentTagsForContentItem = contentItem.As<TagsPart>().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) {
|
||||
|
Reference in New Issue
Block a user