Skip to content

Commit

Permalink
fixed a bug in the mismatch detection logic on content import
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmyhre committed May 17, 2012
1 parent fac3baf commit e203de6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Services/RemoteImportService.cs
Expand Up @@ -32,7 +32,7 @@ public class RemoteImportService : IRemoteImportService {
foreach (var sync in actions.Where(a => a.Action == "Replace"))
{
Logger.Debug("{0}, {1}", sync.Action, sync.TargetId);
if (!LocalIdentifierExists(sync.TargetId, importContentSession))
if (!LocalIdentifierExists(sync, importContentSession))
{
Replace(sync, importContentSession);
} else
Expand Down Expand Up @@ -65,9 +65,13 @@ public class RemoteImportService : IRemoteImportService {
}
}

private bool LocalIdentifierExists(string identifier, ImportContentSession importContentSession)
private bool LocalIdentifierExists(ImportSyncAction identifier, ImportContentSession importContentSession)
{
var contentItem = importContentSession.Get(identifier);
var newIdentifier = identifier.Step.Step.Attribute("Id");
if (newIdentifier == null)
return false;

var contentItem = importContentSession.Get(newIdentifier.Value);
if (contentItem == null)
return false;

Expand Down

0 comments on commit e203de6

Please sign in to comment.