Fixes: U4-4746 Examine does not index updated paths/levels for moved/trashed media, U4-4744 Examine events do not listen for recycle bin emptying

This commit is contained in:
Shannon
2014-04-23 20:28:09 +10:00
parent 021cac9ca5
commit 7ac7bb9714
2 changed files with 28 additions and 5 deletions

View File

@@ -131,15 +131,15 @@ namespace Umbraco.Web.Cache
MediaService.EmptiedRecycleBin += MediaServiceEmptiedRecycleBin;
//Bind to content events - this is for unpublished content syncing across servers (primarily for examine)
ContentService.EmptiedRecycleBin += ContentServiceEmptiedRecycleBin;
ContentService.Saved += ContentServiceSaved;
ContentService.Deleted += ContentServiceDeleted;
ContentService.Copied += ContentServiceCopied;
//TODO: The Move method of the content service fires Saved/Published events during its execution so we don't need to listen to moved
//ContentService.Moved += ContentServiceMoved;
ContentService.Trashed += ContentServiceTrashed;
ContentService.EmptiedRecycleBin += ContentServiceEmptiedRecycleBin;
//public access events
Access.AfterSave += Access_AfterSave;
}

View File

@@ -311,9 +311,32 @@ namespace Umbraco.Web.Search
{
DeleteIndexForEntity(c4.Id, false);
}
break;
case MessageType.RefreshAll:
break;
case MessageType.RefreshByJson:
var jsonPayloads = UnpublishedPageCacheRefresher.DeserializeFromJsonPayload((string)e.MessageObject);
if (jsonPayloads.Any())
{
foreach (var payload in jsonPayloads)
{
switch (payload.Operation)
{
case UnpublishedPageCacheRefresher.OperationType.Deleted:
//permanently remove from all indexes
DeleteIndexForEntity(payload.Id, false);
break;
default:
throw new ArgumentOutOfRangeException();
}
}
}
break;
case MessageType.RefreshAll:
default:
//We don't support these, these message types will not fire for unpublished content
break;